当在CircleCI中为git存储库“giantswarm/docs-content”执行构建时,我希望将提交推送到另一个存储库“giantswarm/docs”。 我在“circle.yml”的“deployment”部分中有以下内容:
git config credential.helper cache
git config user.email "<some verified email>"
git config user.name "Github Bot"
git clone --depth 1 https://${GITHUB_PERSONAL_TOKEN}:x-oauth-basic@github.com/giantswarm/docs.git
cd docs/
git commit --allow-empty -m "Trigger build and publishing via docs-content"
git push -u origin master
这个命令在最后一步失败,并显示以下错误消息:
ERROR: The key you are authenticating with has been marked as read only.
fatal: Could not read from remote repository.
GITHUB_PERSONAL_TOKEN
环境变量被设置为用户的个人访问令牌,该令牌已使用 repo
范围创建,以访问私有存储库 giantswarm/docs
。此外,我将用户添加到一个团队,该团队具有该存储库的管理权限。
在新的 Ubuntu VM 中执行该系列命令时,一切都工作正常。不知道为什么在 CircleCI 上却不能工作?
ERROR: Repository not found. fatal: Could not read from remote repository.
- Mariangit@github.com:giantswarm/docs.git
以SSH方式。 - Mariangit push
实际上是使用 SSH(因为 Travis 最初克隆了仓库),而不是我之前认为的 HTTPS。因此,个人访问令牌甚至都没有被使用。 - Todd Owen