From 691f9cc8e4bf3d29bc5924c1a0a03f7f89bce9a0 Mon Sep 17 00:00:00 2001 From: Tibor Udvari Date: Tue, 10 Sep 2024 12:11:58 +0200 Subject: [PATCH] chore: Add safety check for release action Checks if the version was bumped before pushing version changes to GH and NPM --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d92c78..e6b5437 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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