File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -20,24 +20,29 @@ permissions:
2020 contents : write
2121
2222jobs :
23- wait-for-main-build :
24- runs-on : ubuntu-latest
25- steps :
26- - name : Wait for E2E test to succeed
27- uses : ezhang6811/wait-on-check-action@6275ea93847ce5952ab8ceeac8fb1111820cf44d
28- with :
29- ref : ${{ github.ref }}
30- check-name : ' Application Signals E2E Test'
31- repo-token : ${{ secrets.GITHUB_TOKEN }}
32- wait-interval : 30
33- allowed-conclusions : success
34-
3523 build :
36- needs : wait-for-main-build
3724 environment : Release
3825 runs-on : ubuntu-latest
3926 steps :
4027 - uses : actions/checkout@v5
28+
29+ - name : Check main build status
30+ run : |
31+ WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Java Agent Main Build") | .id')
32+ LATEST_RUN=$(gh api repos/${{ github.repository }}/actions/workflows/$WORKFLOW_ID/runs --jq '.workflow_runs[] | select(.head_branch=="${{ github.ref_name }}") | {conclusion, status}' | head -1)
33+ STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
34+ CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
35+
36+ if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
37+ echo "Main build is still running (status: $STATUS). Cannot proceed with release."
38+ exit 1
39+ elif [ "$CONCLUSION" != "success" ]; then
40+ echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
41+ exit 1
42+ fi
43+ echo "Main build succeeded, proceeding with release"
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4146 - uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
4247 with :
4348 java-version-file : .java-version
You can’t perform that action at this time.
0 commit comments