【发布时间】:2016-01-18 21:06:18
【问题描述】:
我正在尝试在 after_success 期间将 travis CI 项目的构建版本推送到不同的存储库
以下脚本在构建完成后由 travis 运行:
git config user.name "Travis CI"
git config user.email "fake@fake.com"
git config --global push.default simple
git add . -f #force adding to include files in .gitignore
git commit -m "built with love by travis <3"
git remote add production https://${GH_TOKEN}:x-oauth-basic@github.com/my_username/repo.git
git push production master --force #ensure repo is in correct state
GH_TOKEN 是存储在 .travis.yml 中的加密 github 令牌显然,我已经编辑了一些私人信息。
当这个脚本由 travis 运行时,我收到以下错误:
remote: fatal: did not receive expected object [redacted]
error: unpack failed: index-pack abnormal exit
To https://[redacted token]:x-oauth-basic@github.com/my_username/repo.git
! [remote rejected] HEAD -> master (failed)
error: failed to push some refs to 'https://[redacted token]:x-oauth-basic@github.com/my_username/repo.git'
这是我的脚本、travis 或 github 的问题吗?
【问题讨论】:
-
您的 OAuth 令牌是否具有正确的权限?尝试在其配置中勾选更多框。