I have a repository that I am using as a template for semantic release:
release.yml
workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_BRANCH == "test"
when: always
- if: $CI_COMMIT_BRANCH == "main"
when: always
.release:
image: docker-images/semantic-release-test:v0.2.2
variables:
GITLAB_TOKEN: $GITLAB_ACCESS_TOKEN
script:
- npx semantic-release --debug
and I am referencing it in another project
.gitlab-ci.yml
stages:
- release
include:
- project: templates/semantic-release-test
file:
- release.yml
docker_release:
stage: release
extends: .release
the problem is that there is still a second pipeline being created after the script creates a new tag. I did try to implement the logic within the .gitlab-ci.yml
without the template and it works fine. But when I am using the include
key a new pipeline is being triggered regardless.
I have tried many other variation of adding rules to the end of the job or and to the .gitlab-ci.yml
as to the release.yml
but no luck.
Any ideas on why is that happening?