Put together a small test project.
I want in the pipeline:
- update package version.
- publish the package in npm.
- 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?
.gitlab-ci.yml
image: node@sha256:1163a6593bdc407eadb6412aa065393e01135aed67a48a35e3b04182d230e64e
stages:
- hello
- update
hello-stage:
stage: hello
script:
- echo 'Hello World'
update-version:
stage: update
when: manual
script:
- echo 'Update version with yarn 2'
- yarn version check
- yarn version apply
- git config --global user.name "$GITLAB_USER_NAME"
- git config --global user.email "$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
Result
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