Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semtag does not fail if git tag command fails to tag the commit #27

Open
spirosekulovski opened this issue Apr 3, 2024 · 0 comments
Open

Comments

@spirosekulovski
Copy link

There are some cases where a tag already exists, so when the git tag command tries to tag HEAD, it fails with the message fatal: tag '' already exists. However, the script doesn't exit 1 so the CI pipeline continues.

% bash semtag final -s patch
fatal: tag 'v0.0.4' already exists
v0.0.4 pushed to origin

This is a very simple fix: just add || exit 1 to the git tag -a $__version -m "$__message" command on line 516:

semtag/semtag

Line 516 in f5b2c67

git tag -a $__version -m "$__message"

git tag -a $__version -m "$__message" || exit 1

Git's error message is satisfactory so no need for additional logic just for a custom messages.

There is another option: add set -o errexit to the top of semtag. However, I believe this will require additional changes to the semtag to make it work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant