0
votes

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.

enter image description here

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?

enter image description here

1

1 Answers

1
votes

I tried to reproduce your case.

enter image description here

And for this script:

Write-Host $(Build.BuildNumber)

Write-Host $(Release.Artifacts.CustomName.BuildNumber)

I got correct result:

enter image description here

And since the newest build is 20200821.1 it picks up correct number. Please try $(Build.BuildNumber) which works for main artifact.

enter image description here