We are using Azure Devops and want to use the variable "$(Rev:r)" in the update assembly task. However we get build errors when using the this variable.
Yaml task:
- task: update-assembly-info@2 displayName: 'Update Assembly ...........' inputs: assemblyInfoFiles: ........... company: '...........' product: ........... copyright: '© $(Assembly.Company) $(Date:yyyy)' fileVersionMajor: '$(Date:yyyy)' fileVersionMinor: '$(Date:MM)' fileVersionBuild: '$(Date:dd)' fileVersionRevision: '$(Rev:r)' assemblyVersionMajor: '$(Date:yyyy)' assemblyVersionMinor: '$(Date:MM)' assemblyVersionBuild: '$(Date:dd)' assemblyVersionRevision: '$(Rev:r)'
However we get the following error:
##[error]'Allow Scripts to Access OAuth Token' must be enabled when using the $(Rev:r) variable
When we do the exact same steps without using a yaml file but in the GUI in Azure Devops, we can enable the "Allow scripts to access the OAuth token" property and is is working as expected.
How can we enable this OAuth token in the yaml file? So we can use this "$(Rev:r)" in the update assembly task in the yaml file?