nowsthetime
nowsthetime

Reputation: 1

How to run pipeline only on branch and never on tag?

My .gitlab-ci.yml looks like this:

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH
    - if: $CI_COMMIT_TAG
      when: never

stages:
- tmo
- test
- version
- build

but the pipeline still runs for tags. How do I get the desired behavior?

Upvotes: 0

Views: 284

Answers (1)

Ray
Ray

Reputation: 1676

You have the wrong rules and should be updated to below:

Only runs when there is a commit branch, otherwise never runs.

- if: $CI_COMMIT_BRANCH
- when: never

Upvotes: 1

Related Questions