【发布时间】:2021-01-18 04:13:39
【问题描述】:
我正在尝试找到一种方法来通过我的 YAML 管道访问我的私有 github 存储库,该管道在 azure devops 中运行。我可以创建 PAT 访问令牌,但我需要复制此令牌并将其作为秘密值粘贴到 github -> repo -> settings -> secret 中吗?我将如何访问此令牌以访问我的 github 私人仓库?我有以下步骤,但不确定这是否有效:
steps:
- shell: pwsh
env:
SUPER_SECRET: ${{ secrets.SuperSecret }}
run: |
example-command "$env:SUPER_SECRET"
访问我的 gihuh 存储库需要哪些 yaml 任务?我知道使用下面我可以访问公共存储库但不能访问私有存储库:
repositories:
- repository: myrepo
endpoint: svc-github
name: projecta/privaterepo
type: github
对此有什么想法吗?谢谢。
【问题讨论】:
标签: azure github azure-devops yaml azure-pipelines