【发布时间】:2020-06-17 00:59:21
【问题描述】:
我正在尝试在 Github 操作中克隆另一个私人仓库。我在我正在运行操作的回购的秘密中设置了SECRET_USER 和SECRET_PASSWORD。在操作中我正在运行命令
git clone https://$SECRET_USER:$SECRET_PASSWORD@github.com/other-organization/other-repo.git
但出现错误
Cloning into 'other-repo'...
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/other-organization/other-repo.git/'
##[error]Process completed with exit code 128.
在 Github Actions 中,虽然我已经验证用户可以访问 https://github.com/other-organization/other-repo(这显然不是内部 repo 的真实 URL)。
【问题讨论】:
-
git clone https://$SECRET_USER:$SECRET_PASSWORD@github.com/other-organization/other-repo.git在您的本地计算机上是否适合您? -
秘密应该像这样引用
${{ secrets.SECRET_USER }},除非你的run步骤设置env变量。
标签: git github github-actions