0

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
  • What do you mean by "git version tags"? Actually creating a git tag with name formed from MR labels?
    – Ivan
    Jul 2, 2019 at 19:58

1 Answer 1

2

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .