0

I have pipeline that makes some changes and commits another change which triggers another pipeline and I dont want that automatic update to trigger pipeline.

I had an idea that I will specify commit message and that ignore it, but for some reason I cannot get it working.

Can you help me with that?

variables:
  COMMIT_MESSAGE: "MyCommitMessage"

workflow:
  rules:
    - if: $CI_COMMIT_MESSAGE != $COMMIT_MESSAGE
...
torek
  • 448,244
  • 59
  • 642
  • 775
Spooneres
  • 3
  • 2

1 Answers1

1

You have to add the never keyword and use a regex like this :

variables:
  COMMIT_MESSAGE: "MyCommitMessage"

workflow:
  rules:
    - if: $CI_COMMIT_MESSAGE =~ /^.*COMMIT_MESSAGE/
      when: never
    - when: always

The if will be evaluate to true and the pipeline will never run.

fmdaboville
  • 1,394
  • 3
  • 15
  • 28