नीला पुल अनुरोध | नीला Devops - " आप प्रदान करना होगा एक मूल्य अभिव्यक्ति के बाद '+' ऑपरेटर."

0

सवाल

मैं हूँ वर्तमान में चल रहे इस yaml फ़ाइल:

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 रेपो. प्रस्तुत करने से पहले इस पीआर, कृपया सुनिश्चित करें कि:

  • [ ] फिक्स
  • [ ] सुविधा
  • [ ] बड़े

नोट: यदि आप चाहते हैं करने के लिए अलग-अलग शब्दावली, आप को बदलना होगा regex हिस्सा है । एक उदाहरण के रूप में:

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

एक ही समय में, आप होगा करने के लिए एक परिवर्तन बनाने के अंदर चेक बॉक्स है कि आप पोस्ट के अंदर खींचने का अनुरोध करने के लिए सुनिश्चित करें कि यह मैच होगा.

अब, स्क्रिप्ट काम कर रहा है. यदि आप चाहते हैं को देखने के लिए एक गाइड करने के लिए जोड़ें अर्थ संशोधन करने के लिए अपनी परियोजना के साथ, आप होगा देखने के लिए पर गाइड के निर्माता लिंक: 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 है कि ले जाएगा जगह में चेक बॉक्स बनाने के लिए यकीन है कि मैं करने में सक्षम हो जाएगा की घोषणा तो अपने पुल अनुरोध किया जाएगा एक फिक्स, सुविधा या बड़े. जोड़ने के द्वारा के रूप में उपरोक्त पीआर-टिप्पणी इस मुद्दे को हल
Hvaandres

यही मेरा जवाब है, मैं जोड़ा गया टेम्पलेट के लिए मेरी टिप्पणी के अंदर मेरे पीआर है, और है कि विकल्प का चयन मैं जरूरत है. स्क्रिप्ट पढ़ने, और आप देखेंगे कि regex पूछ रहा है आप के लिए चेक बॉक्स, और यदि आप उन के अंदर अपने जनसंपर्क टिप्पणी है, तो आप में सक्षम हो जाएगा खेलने के लिए इस स्क्रिप्ट के साथ. स्क्रिप्ट अपने आप में कुछ भी गलत नहीं है, और मैं यह समझ में नहीं आया पर शुरुआत है, लेकिन अब मैं हल और मैं साझा कर रहा हूँ गाइड है कि मैं पीछा किया
Hvaandres

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

इस श्रेणी में लोकप्रिय

लोकप्रिय सवाल इस श्रेणी में