Skip to content

Commit 130e5bc

Browse files
committed
ci: fail release if source version doesn't match tag
1 parent 302a644 commit 130e5bc

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ permissions:
1313
id-token: write
1414

1515
jobs:
16+
verify-version:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v6
20+
- name: Check source version matches tag
21+
run: |
22+
TAG="${GITHUB_REF_NAME#v}"
23+
SOURCE=$(jq -r .version package.json)
24+
if [ "$TAG" != "$SOURCE" ]; then
25+
echo "::error::Tag v$TAG does not match source version $SOURCE — bump package.json first"
26+
exit 1
27+
fi
28+
1629
test:
30+
needs: verify-version
1731
name: Test (Node ${{ matrix.node-version }})
1832
runs-on: ubuntu-latest
1933
strategy:

0 commit comments

Comments
 (0)