How to skip the pipeline from job Gitlab

Put together a small test project.

I want in the pipeline:

  1. update package version.
  2. publish the package in npm.
  3. commit and push the changes by skipping the next pipe.

But I ran into such a problem that if I run command git push --push-option="ci.skip" locally, the pipeline is skipped. If I launch a push from a job, the next pipeline is not skipped

The git version is 2.11.0 in the job, so you need to use the command git push --push-option="ci.skip"

What am I doing wrong?


image: node@sha256:1163a6593bdc407eadb6412aa065393e01135aed67a48a35e3b04182d230e64e

  - hello
  - update

  stage: hello
    - echo 'Hello World'

  stage: update
  when: manual
    - echo 'Update version with yarn 2'
    - yarn version check
    - yarn version apply
    - git config --global "$GITLAB_USER_NAME"
    - git config --global "$GITLAB_USER_EMAIL"
    - git remote set-url origin "https://gitlab-ci-token:$GIT_PUSH_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git"
    - git --version # 2.11.0
    - git add .
    - git commit -m 'update package' 
    - npm publish
    - git push --push-option='ci.skip' origin HEAD:master # result pipeline not skipped


The pipe is launched to my commit, at 2 stages the package version is updated in the job, commit and push.

Then the pipeline starts again, although it seems to be skipped


with using a specifically crafted commit message, you can define rules in jobs to determine whether to execute them.

    - if $CI_COMMIT_MESSAGE =~ /skip ci/
      when: manual
      allow_failure: true

Similar to what this blog post explains:

Maybe this is a possible solution in your pipeline steps.


If you place [ci skip] in the commit message, then the pipeline is skipped. But then, by hand, the pipeline cannot be launched through the “Run pipeline” button. You need to make a new commit without [ci skip]