File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,22 @@ jobs:
2929 uses : actions/checkout@v4
3030
3131 - name : Check main build status
32+ env :
33+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3234 run : |
3335 WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Python Instrumentation Main Build") | .id')
34- STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/$WORKFLOW_ID/runs --jq '.workflow_runs[] | select(.head_branch=="${{ github.ref_name }}") | .conclusion' | head -1)
35- if [ "$STATUS" != "success" ]; then
36- echo "Latest main build on branch ${{ github.ref_name }} status: $STATUS"
36+ 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)
37+ STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
38+ CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
39+
40+ if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
41+ echo "Main build is still running (status: $STATUS). Cannot proceed with release."
42+ exit 1
43+ elif [ "$CONCLUSION" != "success" ]; then
44+ echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
3745 exit 1
3846 fi
39- env :
40- GH_TOKEN : ${{ github.token }}
47+ echo "Main build succeeded, proceeding with release"
4148
4249 - name : Build Wheel and Image Files
4350 uses : ./.github/actions/artifacts_build
You can’t perform that action at this time.
0 commit comments