PREDEFINED VARIABLE TO FIND OUT WHICH BRANCH TAG WAS CUT FROM.
In Gitlab UI , we cut a tag from a branch. In the list of predefined variables , we can use $CI_COMMIT_TAG
to know if pipeline was triggered from a tag or not . But when we need something like this
Basically to trigger a pipeline only if tag was created from a default branch.
If we cut a tag , $CI_COMMIT_REF_NAME gives the tag name so we don't have any variable which stores the branch name from which the tag was cut. Can we please add that as we have a genuine need for it
release-test:
stage: deploy
script:
- echo "Hello - $CI_COMMIT_TAG ----- $CI_COMMIT_REF_NAME"
rules:
- if: '$CI_COMMIT_TAG != " " && $CI_COMMIT_BRANCH == "$CI_DEFAULT_BRANCH" '
tags:
- ddvs-small