Skip to content

Commit

Permalink
enforce version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Jan 21, 2025
1 parent 03abefb commit ca9090d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Enforce Version Update

on:
pull_request:
branches:
- main

jobs:
check-version:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check version update
id: check-version
run: |
BASE_VERSION=$(git show origin/main:pyproject.toml | grep '^version' | sed 's/version = "\(.*\)"/\1/')
CURRENT_VERSION=$(grep '^version' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
if [ "$BASE_VERSION" = "$CURRENT_VERSION" ]; then
echo "Error: Version in pyproject.toml was not updated."
exit 1
fi
- name: Approve if version updated
if: ${{ steps.check-version.outcome == 'success' }}
run: echo "Version updated successfully!"

0 comments on commit ca9090d

Please sign in to comment.