Color ดึงร้องขอ|Color Devops-"คุณต้องให้เป็นค่าแสดงตามองหมาย'+'โอเปอเรเตอร์."

0

คำถาม

ฉันกำลังทำงานนี้ language แฟ้ม:

trigger:
- none
## notes 
pool:
  vmImage: ubuntu-latest

## Job to calculate semantic version
jobs:
  - job: CalculateVersion
    displayName: Semantic versioning
    
    steps:
      # Checkout with persist credentials
      - checkout: self
        persistCredentials: true

      # Install GitVersion
      - task: gitversion/setup@0
        displayName: Install GitVersion
        inputs:
          versionSpec: '5.x'

      # Retrieve Pull Request Description
      - task: PullRequestDescription@0
        name: RetrievePullRequestDescription
        displayName: Retrieve Pull Request description
        inputs:
          action: 'view'
          outputVariable: 'PullRequest.DescriptionContent'
          isOutput: true
          stripIdentifiers: false

      # Add git commit message that will be picked up by GitVersion ("+semver: patch/minor/major")
      # Depending on the Pull Request description, where the developer has marked the type of change
      - task: PowerShell@2
        displayName: Add git commit message for SemVer
        inputs:
          targetType: inline
          script: |
            Write-Host "Configuring git author info.." -ForegroundColor Cyan
          
            git config user.email "[email protected]"
            git config user.name "alan.haro"
            Write-Host "Doing git checkout..." -ForegroundColor Cyan
            git checkout -b $("$(System.PullRequest.SourceBranch)".replace('refs/heads/creating-git-tags', ''))
            Write-Host "Checking Pull Request description..." -ForegroundColor Cyan
            $PRdesc = "$(RetrievePullRequestDescription.PullRequest.DescriptionContent)"
            if ($PRdesc -match '(\[x\] \bFix\b)') {
              Write-Host "Adding git (empty) commit message to mark this branch as a 'patch' SemVer increment." -ForegroundColor Cyan
              git commit -a -m "+semver: patch [skip azurepipelines]" --allow-empty
            } elseif ($PRdesc -match '(\[x\] \bFeature\b)') {
              Write-Host "Adding git (empty) commit message to mark this branch as a 'minor' SemVer increment." -ForegroundColor Cyan
              git commit -a -m "+semver: minor [skip azurepipelines]" --allow-empty
            } elseif ($PRdesc -match '(\[x\] \bBig\b)') {
              Write-Host "Adding git (empty) commit message to mark this branch as a 'major' SemVer increment." -ForegroundColor Cyan
              git commit -a -m "+semver: major [skip azurepipelines]" --allow-empty
            } else {
              Write-Host "##vso[task.LogIssue type=error;]Please select the type of change in the Pull Request description, and Re-queue the validation." -ForegroundColor Cyan
              $PRdesc
              exit 1
            }
            Write-Host "Doing git push.." -ForegroundColor Cyan
            git push --set-upstream origin $("$(System.PullRequest.SourceBranch)".replace('refs/heads/', ''))
            Write-Host "Done." -ForegroundColor Cyan
          
      # Determine the semantic version & test test
      - task: gitversion/execute@0
        displayName: Determine SemVer

เพื่อให้แน่ใจว่ามันวิ่งหนีฉันจะต้องผ่านตามคำสั่งอยู่ในความคิดเห็นจากการประชาสัมพันธ์ใหม่:

git commit -a -m "+'semver: minor [skip azurepipelines]'" --allow-empty

ด้วยการทำเรื่องนี้ฉันจะมีคนตามเรื่อง:

"คุณต้องให้เป็นค่าแสดงตามองหมาย'+'โอเปอเรเตอร์."

มีใครรู้ว่าอะไรคือสาเหตุที่ฉันสามารถทำอย่างนี้เพื่อป้องกันไม่ให้ประเภทของข้อความผิดพลาด?

1

คำตอบที่ดีที่สุด

-2

ฉันแก้ปัญหาของฉันโดยการเพิ่มคลังตามแม่แบบในการประชาสัมพันธ์ของฉันรายละเอียด:

รายละเอียด ขอบคุณสำหรับของคุณช่ไป Bla Bla สาวนั่น. ก่อนที่ submitting นี้ประชาสัมพันธ์ขอร้องให้แน่ใจว่า:

  • []ซ่อม
  • []วามสามารถของคุณสมบัติ
  • []ใหญ่

ข้อควรจำ:หากคุณต้องต้องแตกต่าง terminology คุณจะต้องเปลี่ยน regex นส่วนหนึ่ง. เป็นตัวอย่าง:

 if ($PRdesc -match '(\[x\] \**bFix**\b)')

ในเวลาเดียวกัน,คุณจะต้องเปลี่ยนแปลงข้างในของ checkboxes ที่คุณเพิ่มเข้าไปข้างในของดึงร้องขอที่จะทำให้แน่ใจว่ามันจะตรงกัน

ตอนนี้,สคริปต์มันทำงานอยู่ ถ้าคุณอยากจะเจอผู้นำทางที่จะเพิ่มกำกับ versioning ของโครงการคุณจะต้องตรวจสอบดูก่อนที่นำทางเป็นผู้สร้างเชื่อมโยง: https://www.moderndata.ai/2021/10/automatic-semantic-versioning-in-azure-devops-with-release-notes/. ดูหลักปัญหาที่ฉันสร้างขึ้นมา- $(ระบบPullRequest.SourceBranch)ไม่พบ.

2021-11-24 20:07:00

ของต้นฉบับภารกิจคือ git ทำผิดพลาด ยังไงคำตอบของคุณแก้ปัญหาได้เหรอ?
John Hanley

เพิ่ม git ทำข้อความสำหรับ SemVer Powershell สคริปต์มีบางอย่า regex นั้นจะอยู่ในสถานที่ที่ checkboxes เพื่อให้แน่ใจว่าฉันจะสามารถที่จะประกาศถ้าฉันดึงการร้องของเจ้าจะเป็นแก้ไข,คุณสมบัติหรือใหญ่มาก โดยการเพิ่มรูปแบบที่อยู่เหนือในการประชาสัมพันธ์-หมายเหตุแก้ปัญหา
Hvaandres

นั่นคือคำตอบของฉันฉันเพิ่มต้นแบบสำหรับความคิดเห็นของฉันในการประชาสัมพันธ์ของฉันและเลือกตัวเลือกนั้นฉันต้องการ อ่านสคริปต์และคุณจะเห็นว่า regex เป็นของคุณสำหรับ checkboxes และถ้าคุณเพิ่มพวกนั้นข้างในของของคุณการประชาสัมพันธ์หมายเหตุ,คุณจะสามารถที่จะเล่นกับเรื่องนี้สคริปต์ สคริปต์ตัวมันเองได้ไม่มีอะไรผิดพลาด,และฉันไม่เข้าใจมันตอนแรกแต่ตอนนี้ฉันแก้ไขได้แล้วฉันแบ่งปันคนนำทางที่ฉันตาม
Hvaandres

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่