我有一个Azure DevOps管道,我想标记Azure Git存储库
task: AssembyInfoReader@2
displayName: Set Version numbers
inputs:
searchPattern: 'JLReyLibrary/Properties/GlobalAssemblyInfo.cs'
获取程序集信息变量。
然后此任务导致错误:
task: GitTag@2
displayName: Tag Repo to $(AssemblyInfo.AssemblyInformationVersion)
inputs:
tag: '$(AssemblyInfo.AssemblyInformationalVersion)'
forceTagCreation: true
##[error]OAuth token not found. Make sure to have 'Allow Scripts to Access OAuth Token' enabled in the build definition.
如何设置OAuth令牌?
我尝试了以下建议。
现在我有以下问题。
env: Systems_AccessToken: $(System.AccessToken)
中获取它我找到了“ DevOps->组织设置-> OAuth配置”
我仍然收到以下错误消息:
Allow Scripts to Access OAuth Token
答案 0 :(得分:0)
您需要将此添加到任务中
env:
System_AccessToken: $(System.AccessToken)
所以,在您的情况下:
- task: GitTag@2
displayName: Tag Repo to $(AssemblyInfo.AssemblyInformationVersion)
inputs:
tag: '$(AssemblyInfo.AssemblyInformationalVersion)'
forceTagCreation: true
env:
System_AccessToken: $(System.AccessToken)