【发布时间】:2022-11-20 21:18:24
【问题描述】:
我想在我的 Github Actions 工作流中签出一个公共存储库,该工作流在 Enterprise Github 中托管的存储库中运行。我正在使用在我的公共 Github 帐户中生成的 PAT 来进行身份验证。
我检查公共回购的工作流程步骤如下所示:
- name: Check out the public repository
uses: actions/checkout@v3
with:
repository: public_org_name/public_git_repo_name
token: ${{ secrets.PAT }}
github-server-url: https://github.com
我有一个错误说它是错误的凭据。在我的公共 github 帐户中生成的 PAT 值与我的 github secrets PAT 的值相同。
错误日志:
Determining the default branch
Retrieving the default branch name
Bad credentials
Waiting 14 seconds before trying again
Retrieving the default branch name
Bad credentials
Waiting 19 seconds before trying again
Retrieving the default branch name
Error: Bad credentials
在日志中的 git repo 初始化期间,我有:
/bin/git remote add origin https://ENTEPRISE_GITHUB.COM/public_org_name/public_git_repo_name
这不应该是:
https://github.com/public_org_name/public_git_repo_name
我也收到这个警告
Warning: Unexpected input(s) 'github-server-url', valid inputs are ['repository', 'ref', 'token', 'ssh-key', 'ssh-known-hosts', 'ssh-strict', 'persist-credentials', 'path', 'clean', 'fetch-depth', 'lfs', 'submodules', 'set-safe-directory']
github-server-url 是合法的参数,如docs 所示
还,值得一提的是,我可以毫无问题地克隆我的公共仓库 git clone
例子:
- name: Code Checkout
run: |
git clone https://username:${{ secrets.PAT }}@github.com/public_org_name/public_git_repo_name.git
bad credentials 错误是否具有误导性?我是否没有以正确的方式进行结帐操作?
【问题讨论】:
标签: github github-actions