gitlab ci忽略了ci.skip
我正在尝试在GitLab CI上创建一个管道,每次我们在Master上获得提交时都会增加应用程序版本。但这忽略了我的ci.skip命令,我不知道为什么。
YAML文件是一个:
.gitlab-ci.yml,
workflow:
rules:
- if: $CI_COMMIT_BRANCH == 'master'
before_script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git remote set-url origin https://push:$PUSH_KEY@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
auto_release:
image: node:10
script:
- yarn
- yarn release
- git push --follow-tags origin HEAD:master -o ci.skip
- echo "Done!"
因此每次我推新提交时,它都会锁定在一个永恒的循环中,该循环使用新版本并反复使用新版本。停止的唯一方法是手动取消工作。
请注意:当我们使用image 节点
或节点:最新
时,我们的版本需要node:10
否则会破裂并赢t构建。
I'm trying to create a pipeline on Gitlab CI that increments the app version everytime we get a commit on master. But it is ignoring my ci.skip command and I don't know why.
The yaml file is this one:
.gitlab-ci.yml
workflow:
rules:
- if: $CI_COMMIT_BRANCH == 'master'
before_script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git remote set-url origin https://push:$PUSH_KEY@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
auto_release:
image: node:10
script:
- yarn
- yarn release
- git push --follow-tags origin HEAD:master -o ci.skip
- echo "Done!"
So everytime I push a new commit it gets locked inside an eternal loop that commits a new version and commits a new version over and over again. The only way to stop is manually cancelling the jobs.
Pleas note: When we use the image node
or node:latest
it works, but our version requires node:10
otherwise it will break and won't build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
节点:10
是一个非常古老的图像。它包含的GIT版本不支持推送选项(至少使用Shorthand-O
),因此这就是为什么推动触发下一个CI构建的原因。检查图像中的GIT版本 - 如果是2.10至2.17,则可以使用
-push-option = ci.skip
。如果它仍然是一个较旧的版本,则需要创建自己的Docker映像,其中包含节点版本10和现代GIT版本。node:10
is a very old image. The git version it contains does not support push options (at least with the shorthand-o
), so that's why the push triggers the next CI build.Check the git version in the image - if it's 2.10 to 2.17 you can use
--push-option=ci.skip
. If it's still an older version, you need to create your own docker image that contains node version 10 and a modern git version.