gitlab ci忽略了ci.skip

发布于 2025-02-02 07:08:22 字数 745 浏览 3 评论 0原文

我正在尝试在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

饮惑 2025-02-09 07:08:22

节点: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文