Repository navigation
chore: test integration test action #1089
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Version Bump | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-version-bump: | |
| name: Check Version Bump | |
| runs-on: ${{ contains(github.server_url, 'github.com') && 'ubuntu-latest' || fromJSON('["self-hosted"]') }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Reject manual version bumps in pyproject.toml | |
| run: | | |
| BASE_SHA="${{ github.event.pull_request.base.sha }}" | |
| HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
| MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA") | |
| BASE_VERSION=$(git show "$MERGE_BASE:pyproject.toml" | grep "^version = " | cut -d'"' -f2) | |
| HEAD_VERSION=$(git show "$HEAD_SHA:pyproject.toml" | grep "^version = " | cut -d'"' -f2) | |
| if [[ "$BASE_VERSION" != "$HEAD_VERSION" ]]; then | |
| echo "ERROR: Manual version bump detected in pyproject.toml." | |
| echo " Base: $BASE_VERSION" | |
| echo " PR: $HEAD_VERSION" | |
| echo "" | |
| echo "The version is managed automatically by the release pipeline." | |
| echo "Remove the version change from pyproject.toml and use /release-prep to trigger a release." | |
| exit 1 | |
| fi | |
| echo "Version unchanged ($HEAD_VERSION) — OK." |