Skip to content

Commit

Permalink
chore: Add safety check for release action
Browse files Browse the repository at this point in the history
Checks if the version was bumped before pushing version changes to GH
and NPM
  • Loading branch information
TiborUdvari committed Sep 10, 2024
1 parent de852d2 commit 691f9cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}

- name: Check if version was bumped
run: |
LAST_TAG=$(git describe --tags --abbrev=0)
HEAD_TAG=$(git describe --tags)
if [ "$LAST_TAG" == "$HEAD_TAG" ]; then
echo "No new version detected, skipping push and publish."
exit 0
fi
- name: Push version changes
run: |
git push --follow-tags origin main
Expand Down

0 comments on commit 691f9cc

Please sign in to comment.