How do I run a .gitlab-ci.yml job only on a tagged Master branch?
job:
script:
- echo \"Do something\"
only:
- master
- tags
The
This behavior will be introduced in version 12.
Open issue was recently update:
Jason Lenny @jlenny changed title from {-Update .gitlab-ci.yml to support conjunction logic for build conditions-} to Conjunction logic for build conditions MVC · 2 days ago
Jason Lenny @jlenny changed milestone to 12.0 · 2 days ago
(fingers crossed)
A solution is to use the except
keyword to exclude all the branches, in conjunction with only
to run on tags, in this way you run your pipeline only on tag in master branch:
only:
- tags
except:
- branches
I'm using version 11.3.4