【问题标题】:'Allow Scripts to Access OAuth Token' must be enabled必须启用“允许脚本访问 OAuth 令牌”
【发布时间】:2019-06-11 15:13:49
【问题描述】:

谁能解释我如何让它工作?
我有一个使用作业模板和步骤模板的管道。

我可以设置变量

variables:
      SYSTEM_ACCESSTOKEN: $(System.AccessToken)

variables:
      system_accesstoken: $(System.AccessToken)

在起始管道和步骤模板中,但它不起作用。
(according to this question)

我不断得到:

[错误]“允许脚本访问 OAuth 令牌”必须启用。

如果我通过可视化设计器设置并查看yaml或导出管道,我找不到任何设置'Allow OAuth...'的参考。

This 对于基于 yaml 的管道也没有帮助...

这是需要令牌的任务:

- task: bool.fetch-build-artifact.fetch-build-artifact-task.fetch-build-artifact@3
    displayName: 'Fetch'
    inputs:
      project: '[omitted]'
      buildDefinitionId: 159
      artifactName: drop.develop
    env:
      SYSTEM_ACCESSTOKEN: $(System.AccessToken)

【问题讨论】:

    标签: continuous-integration azure-devops yaml azure-pipelines


    【解决方案1】:

    请务必检查您是否使用
    - task: DownloadBuildArtifacts@0
    不是
    bool.fetch-build-artifact.fetch-build-artifact-task.fetch-build-artifact@3

    我最终使用了什么:

    - task: DownloadBuildArtifacts@0
        displayName: 'Download Build Artifacts'
        inputs:
          buildType: specific
          project: '[project GUID omitted here]'
          pipeline: 159
          artifactName: drop.develop
        env:
          SYSTEM_ACCESSTOKEN: $(System.AccessToken)
    

    【讨论】:

      猜你喜欢
      • 2018-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-17
      • 2013-10-07
      • 1970-01-01
      • 2019-07-23
      • 1970-01-01
      相关资源
      最近更新 更多