File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Require Version Bump
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ paths :
8
+ - ' src/rai_core/pyproject.toml'
9
+ - ' src/rai_core/**'
10
+
11
+ jobs :
12
+ require-version-bump :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Checkout repository
17
+ uses : actions/checkout@v4
18
+ with :
19
+ fetch-depth : 0
20
+
21
+ - name : Get rai_core version from BASE and HEAD
22
+ id : require-version-bump
23
+ run : |
24
+ BASE_SHA=${{ github.event.pull_request.base.sha }}
25
+ HEAD_SHA=${{ github.event.pull_request.head.sha }}
26
+ FILE_PATH="src/rai_core/pyproject.toml"
27
+
28
+ git show $BASE_SHA:$FILE_PATH > base.txt || echo "BASE file not found"
29
+ git show $HEAD_SHA:$FILE_PATH > head.txt || echo "HEAD file not found"
30
+
31
+ - name : Compare version lines
32
+ run : |
33
+ BASE_VERSION=$(grep '^version =' base.txt || echo "MISSING")
34
+ HEAD_VERSION=$(grep '^version =' head.txt || echo "MISSING")
35
+
36
+ echo "BASE: $BASE_VERSION"
37
+ echo "HEAD: $HEAD_VERSION"
38
+
39
+ if [ "$BASE_VERSION" = "$HEAD_VERSION" ]; then
40
+ echo "❌ Version has not changed. Please bump the version in the pyproject.toml file according to Semantic Versioning."
41
+ exit 1
42
+ else
43
+ echo "✅ Version changed."
44
+ fi
You can’t perform that action at this time.
0 commit comments