Skip to content

Commit 6c73b75

Browse files
ayhammoudaclaude
andcommitted
fix(08): verify tag matches pyproject.toml version in release workflow (WR-03)
Prevents publishing under a misleading GitHub Release tag when the tag name does not match the version declared in pyproject.toml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9a21190 commit 6c73b75

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ jobs:
2727
- name: Install dependencies
2828
run: uv sync --dev
2929

30+
- name: Verify tag matches package version
31+
run: |
32+
TAG_VERSION="${GITHUB_REF_NAME#v}"
33+
PKG_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
34+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
35+
echo "::error::Tag ${GITHUB_REF_NAME} does not match pyproject.toml version ${PKG_VERSION}"
36+
exit 1
37+
fi
38+
echo "Version check passed: ${PKG_VERSION}"
39+
3040
- name: Run linter
3141
run: uv run ruff check src/ tests/
3242

0 commit comments

Comments
 (0)