How to tag a git commit in pipeline using bitbucket-pipelines.yml file?
How to tag a git commit in pipeline using bitbucket-pipelines.yml file?
Mine script is below. To use it you need to
- step: &tag
name: Tag version
image: atlassian/default-image:2
script:
- git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
- dt=$(date '+%Y-%m-%d_%H%M');
- git tag $dt ${BITBUCKET_COMMIT}
- git push origin --tags
Here you have full documentation of pipeline-git authorization: https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html