File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 default : false
1515
1616jobs :
17+ guard :
18+ name : Require green main.yml for this commit
19+ runs-on : ubuntu-latest
20+ permissions :
21+ actions : read
22+ steps :
23+ - name : Check latest main.yml conclusion
24+ env :
25+ GH_TOKEN : ${{ github.token }}
26+ run : |
27+ conclusion=$(gh api \
28+ "repos/${{ github.repository }}/actions/workflows/main.yml/runs?head_sha=${{ github.sha }}&status=completed" \
29+ --jq '.workflow_runs[0].conclusion // "missing"')
30+ echo "main.yml conclusion for ${{ github.sha }}: $conclusion"
31+ if [ "$conclusion" != "success" ]; then
32+ echo "::error::main.yml is not green for ${{ github.sha }} (got: $conclusion). Run publish from a commit on main whose CI passed."
33+ exit 1
34+ fi
35+
1736 publish :
1837 name : Publish to Maven Central
38+ needs : guard
1939 runs-on : ubuntu-latest
2040 environment :
2141 name : maven-central
You can’t perform that action at this time.
0 commit comments