Skip to content

Commit 89b539f

Browse files
committed
build: update publish workflow
1 parent 2e63b95 commit 89b539f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ jobs:
1818
with:
1919
node-version: '24'
2020
- run: npm ci
21+
- name: Verify tag matches package.json version
22+
if: startsWith(github.ref, 'refs/tags/')
23+
run: |
24+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
25+
PKG_VERSION=$(node -p "require('./package.json').version")
26+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
27+
echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
28+
exit 1
29+
fi
30+
echo "Version check passed: $PKG_VERSION"
2131
- run: npm run build
2232
- run: npm test
2333
- run: npm publish --provenance

0 commit comments

Comments
 (0)