I am trying to add git version tags based on labels attached with a merge request, how can I get them in pipelines scripts?
1 Answer
Luckily there is a variable just for that in Predefined environment variables reference
See CI_MERGE_REQUEST_LABELS
Comma-separated label names of the merge request if the pipelines are for merge requests. Available only if only: [merge_requests] is used and the merge request is created.
As mentioned you will need to define for your job in .gitlab-ci.yml
:
only:
- merge_requests