A
A
Alex2019-08-03 09:55:45
GitLab
Alex, 2019-08-03 09:55:45

How to set task trigger condition in GitLab?

I want one task to run on every commit to any branch, provided there is something in the changes other than .md file changes. I tried like this:

except:
    changes:
      - "*.md"

But the task did not start when changes in the code came in
. I want to start the second one only when the tag is pushed to the master branch,
I tried this
only:
    - tags
    - master
  except:
    changes:
      - "*.md"

But, again, the task simply does not run.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kratorr, 2019-08-12
@kratorr

This will only work with Gitlab 11.4 and above.

stages:
  - my_stage

my_job:
  stage: my_stage
  tags:
   - my_runner
  script:
    - echo "my_job"
  only:
    - tags
    - master
  changes:
    - "*.md"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question