Skip to content

Commit be12a7b

Browse files
committed
chore: Add validate-version job to release workflow
1 parent 7ffb4ad commit be12a7b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ permissions:
1010
id-token: write
1111

1212
jobs:
13+
validate-version:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
20+
with:
21+
version: "latest"
22+
enable-cache: true
23+
24+
- name: Validate version matches tag
25+
run: |
26+
TAG_VERSION=${{ github.ref_name }}
27+
PYPROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
28+
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
29+
echo "Error: Git tag ($TAG_VERSION) doesn't match pyproject.toml version ($PYPROJECT_VERSION)"
30+
exit 1
31+
fi
32+
1333
lint:
1434
runs-on: ubuntu-latest
1535
steps:

0 commit comments

Comments
 (0)