Skip to content

Commit ca9090d

Browse files
committed
enforce version updates
1 parent 03abefb commit ca9090d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Enforce Version Update
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-version:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Check version update
17+
id: check-version
18+
run: |
19+
BASE_VERSION=$(git show origin/main:pyproject.toml | grep '^version' | sed 's/version = "\(.*\)"/\1/')
20+
CURRENT_VERSION=$(grep '^version' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
21+
if [ "$BASE_VERSION" = "$CURRENT_VERSION" ]; then
22+
echo "Error: Version in pyproject.toml was not updated."
23+
exit 1
24+
fi
25+
- name: Approve if version updated
26+
if: ${{ steps.check-version.outcome == 'success' }}
27+
run: echo "Version updated successfully!"

0 commit comments

Comments
 (0)