Skip to content

Commit 424bba7

Browse files
authored
fix: skip npm publish when no new release is created (#24)
Made-with: Cursor
1 parent adf2e9b commit 424bba7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,26 @@ jobs:
5252
run: |
5353
echo "🚀 Mero.js Release"
5454
echo "📦 Package: @calimero-network/mero-js"
55-
pnpm exec semantic-release
55+
OUTPUT=$(pnpm exec semantic-release 2>&1) || true
56+
echo "$OUTPUT"
57+
if echo "$OUTPUT" | grep -q "Published release"; then
58+
echo "new_release=true" >> $GITHUB_OUTPUT
59+
else
60+
echo "new_release=false" >> $GITHUB_OUTPUT
61+
echo "ℹ️ No new release — no releasable commits since last version"
62+
fi
5663
env:
5764
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5865
NODE_ENV: production
5966

6067
- name: Publish to npm with OIDC
68+
if: steps.semantic.outputs.new_release == 'true'
6169
run: |
6270
echo "📦 Publishing to npm with OIDC trusted publishing..."
6371
npm publish --provenance --access public
6472
6573
- name: Push release commit and tag
66-
if: success()
74+
if: steps.semantic.outputs.new_release == 'true'
6775
run: |
6876
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
6977
git push origin HEAD:master --follow-tags || true

0 commit comments

Comments
 (0)