File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Version Check
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+
7+ jobs :
8+ check-version :
9+ name : version-check
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
15+
16+ - name : Check version bump
17+ run : |
18+ # Get version from PR branch
19+ PR_VERSION=$(jq -r '.Version // "0.0.0"' dataset_description.json)
20+
21+ # Get version from main branch
22+ git fetch origin main
23+ git checkout origin/main -- dataset_description.json 2>/dev/null || echo '{}' > dataset_description.json
24+ MAIN_VERSION=$(jq -r '.Version // "0.0.0"' dataset_description.json)
25+
26+ # Restore PR version
27+ git checkout HEAD -- dataset_description.json
28+
29+ echo "Main version: $MAIN_VERSION"
30+ echo "PR version: $PR_VERSION"
31+
32+ if [ "$PR_VERSION" == "$MAIN_VERSION" ]; then
33+ echo "::error::Version not bumped. Update 'Version' field in dataset_description.json"
34+ exit 1
35+ fi
36+
37+ echo "Version check passed: $MAIN_VERSION -> $PR_VERSION"
You can’t perform that action at this time.
0 commit comments