How to allow scripts to access OAuth token from yaml builds

后端 未结 1 1090
抹茶落季
抹茶落季 2020-12-19 02:55

My build script uses the SYSTEM_ACCESSTOKEN environment variable.

In the designer build definition I checked Allow scripts to access the OAuth token

相关标签:
1条回答
  • 2020-12-19 03:27

    I found the solution in the Pipeline Variable docs: The variable must be declared in YAML.

    At pipeline level for all jobs / tasks:

    variables:
      system_accesstoken: $(System.AccessToken)
    
    jobs:
      job: ...
    

    Or at script / task level for example PowerShell:

    - powershell: ./build.ps1
      env:
          system_accesstoken: $(System.AccessToken)
    
    0 讨论(0)
提交回复
热议问题