Skip to content

Commit 97b0903

Browse files
authored
Merge branch 'main' into suppress-starlette
2 parents 05f3cd8 + 7e79092 commit 97b0903

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/release-build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ jobs:
2828
- name: Checkout Repo @ SHA - ${{ github.sha }}
2929
uses: actions/checkout@v4
3030

31+
- name: Check main build status
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Python Instrumentation Main Build") | .id')
36+
LATEST_RUN=$(gh api repos/${{ github.repository }}/actions/workflows/$WORKFLOW_ID/runs --jq '[.workflow_runs[] | select(.head_branch=="${{ github.ref_name }}")] | sort_by(.created_at) | .[-1] | {conclusion, status}')
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"
45+
exit 1
46+
fi
47+
echo "Main build succeeded, proceeding with release"
48+
3149
- name: Build Wheel and Image Files
3250
uses: ./.github/actions/artifacts_build
3351
with:

0 commit comments

Comments
 (0)