我正在尝试为版本字符串修改package.json
并作为CI的一部分提交,但是git push
对我来说失败了。以下是我阶段gitlab-ci.yml
中的代码:
before_script:
- git remote set-url origin https://userid:${CI_PUSH_TOKEN}@gitlaburl.com/datastorage/project.git
script:
- call npm install gulp-json-modify --save
- git checkout -B myBranch
- call npm run modifyBuildVersion
- git add package.json
- git commit -m "[skip_ci]Automated commit from CI runner"
- git push --follow-tags origin myBranch
其中CI_PUSH_TOKEN是我在settings-> CI / CD下创建的环境变量,并且此键包含个人访问令牌的值。 在git push的步骤中,我遇到了错误
“远程:HTTP基本:访问被拒绝致命:身份验证失败”
你知道这里怎么了吗? 我试图四处搜寻,但没有太多帮助。
答案 0 :(得分:0)
您是否为回购中的用户ID至少赋予"record":{}
的权利?
如果您使用gitlab-ci-token作为用户,则暂时无法推送(在Gitlab 11.8中)。有一个开放的feature request。