【发布时间】:2021-01-23 23:50:30
【问题描述】:
我有一堆使用 Azure Pipelines for CI/CD 的存储库,我现在正尝试将其移植到 Github Actions。这是我正在研究的第一个:https://github.com/Azure/AzureAuth/tree/fix-ghaction
我已经让它 99% 正常工作,但我在一个步骤中遇到了一个奇怪的身份验证错误。 repo 被镜像到另一个组织(cloudyr),我使用这个步骤来做镜像:
- name: Copy to Cloudyr
if: runner.os == 'Linux'
env:
token: "${{ secrets.ghPat }}"
run: |
export CLOUDYR_REPO=$(echo $GITHUB_REPOSITORY | sed "s/Azure/cloudyr/")
git push --prune https://$token@github.com/${CLOUDYR_REPO}.git +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*
这会从存储库机密中检索 PAT,并执行 git push。它在 Azure Pipelines 上运行良好,但现在失败并出现以下错误:
Run export CLOUDYR_REPO=$(echo $GITHUB_REPOSITORY | sed "s/Azure/cloudyr/")
remote: Permission to cloudyr/AzureAuth.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/cloudyr/AzureAuth.git/': The requested URL returned error: 403
Error: Process completed with exit code 128.
谁能解释造成这种情况的原因以及如何解决?我拥有对 Azure/AzureAuth 和 cloudyr/AzureAuth 存储库的管理员访问权限。我还检查了 PAT 是否有效。
失败日志在这里:https://github.com/Azure/AzureAuth/runs/1228152900?check_suite_focus=true
【问题讨论】:
标签: git github github-actions