Skip to content

Commit

Permalink
fix: Sanitized tags during release CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
iwishiwasaneagle authored Dec 10, 2023
1 parent f8e85a6 commit 7784773
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ jobs:
- name: Should it run?
id: skip
run: |
PREVTAGCOMMIT="$(git tag --sort=creatordate | tail -n1 | awk -F'-' '{print $4}')"
# Resolve the current tag into it's commit to be able to directly compare
# with HEAD. This means that a manual tag such as "version 1.0" will not
# cause the CI job to create a new tag pointing to the same commit.
PREVTAGCOMMIT_UNSANITIZED="$(git tag --sort=creatordate | tail -n1)"
PREVTAGCOMMIT_SANITIZED="$(git rev-list -n 1 $PREVTAGCOMMIT_UNSANITIZED)"
PREVTAGCOMMIT="$(git rev-parse --short $PREVTAGCOMMIT_SANITIZED)"
CURRENTCOMMIT="$(git rev-parse --short HEAD)"
if [ "$PREVTAGCOMMIT" == "$CURRENTCOMMIT" ]; then
echo "Tags are the same ($PREVTAGCOMMIT != $CURRENTCOMMIT), skipping future steps"
Expand Down

0 comments on commit 7784773

Please sign in to comment.