I'm trying to have my GitLab pipeline automatically tag the master branch but with no luck.
What I want to do
Since the project is a composer package, what I want to do is get the version number from the composer.json file, store it in a variable, and then use this variable with git to tag the branch.
What I'm doing
Here is the pipeline job part from my .gitlab-ci.yml:
tagging:
stage: publish
image: alpine
only:
- master
script:
- version=$(cat composer.json | grep version | grep -Eo "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
- git tag "$(version)"
- git push --tags
The error
I can't actually tell what the problem is since no output is displayed in the GitLab job output as show in the picture below
