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 @@ -21,26 +21,31 @@ permissions:
2121 contents : write
2222
2323jobs :
24- wait-for-main-build :
25- runs-on : ubuntu-latest
26- steps :
27- - name : Wait for E2E test to succeed
28- uses : ezhang6811/wait-on-check-action@6275ea93847ce5952ab8ceeac8fb1111820cf44d
29- with :
30- ref : ${{ github.ref }}
31- check-name : ' Application Signals E2E Test'
32- repo-token : ${{ secrets.GITHUB_TOKEN }}
33- wait-interval : 30
34- allowed-conclusions : success
35-
3624 build :
37- needs : wait-for-main-build
3825 environment : Release
3926 runs-on : ubuntu-latest
4027 steps :
4128 - name : Checkout Contrib Repo @ SHA - ${{ github.sha }}
4229 uses : actions/checkout@v4
4330
31+ - name : Check main build status
32+ run : |
33+ WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="NodeJS Instrumentation Main Build") | .id')
34+ 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)
35+ STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
36+ CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
37+
38+ if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
39+ echo "Main build is still running (status: $STATUS). Cannot proceed with release."
40+ exit 1
41+ elif [ "$CONCLUSION" != "success" ]; then
42+ echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
43+ exit 1
44+ fi
45+ echo "Main build succeeded, proceeding with release"
46+ env :
47+ GH_TOKEN : ${{ github.token }}
48+
4449 - name : Build Tarball and Image Files
4550 uses : ./.github/actions/artifacts_build
4651 with :
You can’t perform that action at this time.
0 commit comments