Skip to content

Commit 6b0e394

Browse files
committed
ci: check tag with pkg version
1 parent 7787581 commit 6b0e394

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
with:
2323
node-version: 24
2424
cache: 'npm'
25+
- name: Compare release tag with package.json
26+
if: github.event_name == 'release'
27+
run: |
28+
RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
29+
PKG_VERSION=$(node -p "require('./package.json').version")
30+
31+
echo "Release tag: $RELEASE_VERSION"
32+
echo "package.json: $PKG_VERSION"
33+
34+
[ "$RELEASE_VERSION" = "$PKG_VERSION" ] || { echo "❌ Mismatch"; exit 1; }
35+
2536
- run: npm ci
2637
- run: npm test
2738
env:

0 commit comments

Comments
 (0)