I am trying to tag the active git branch with the build number so that we can know what all code changes have got into the build. Referring to this Setting Git Tag from Azure Devops Build Pipeline on Complete I made entries in the YAML file. Below is the YAML code changes.
steps:
- checkout: 'self'
clean: true
persistCredentials: true
- script: |
git tag Build_$(Build.BuildId)
git push origin Build_$(Build.BuildId)
workingDirectory: $(Build.SourcesDirectory)
The pipeline build succeeds and I am able to see the tag applied
However, when I see the build logs I see below error. I don't understand what is the problem
[error]To https://dev.azure.com/{Org}/{Project}/_git/{Repo}
[error] * [new tag] Build_10691 -> Build_10691
Please help me fix this issue.
git push
command in your script togit push -q origin Build_$(Build.BuildId)
? – Yan Sklyarenko-q
options works like a charm to resolve the error. – LoLance