Reputation: 4855
I have a release pipeline in Azure Devops. In the release pipeline I have a bash script -step that references the variable $(Release.Artifacts.MyCustomAlias.BuildNumber). In the script I echo the value of the variable.
Now I created a new release and selected the build 20200820.22 as the artifact.
When checking the output of the script it is using the value 20200821.2, which is the latest build, but not the one I selected.
How can I access the correct build version from the release script?
Upvotes: 1
Views: 1798
Reputation: 40939
I tried to reproduce your case.
And for this script:
Write-Host $(Build.BuildNumber)
Write-Host $(Release.Artifacts.CustomName.BuildNumber)
I got correct result:
And since the newest build is 20200821.1
it picks up correct number. Please try $(Build.BuildNumber)
which works for main artifact.
Upvotes: 2