Skip to content

Commit 07f1157

Browse files
committed
Revert "remove main build check"
This reverts commit ece9622.
1 parent f90435f commit 07f1157

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/release-build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
3535

36-
# - name: Check main build status
37-
# env:
38-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
# run: |
40-
# WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Java Agent Main Build") | .id')
41-
# 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}')
42-
# STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
43-
# CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
36+
- name: Check main build status
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Java Agent Main Build") | .id')
41+
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}')
42+
STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
43+
CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
4444
45-
# if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
46-
# echo "Main build is still running (status: $STATUS). Cannot proceed with release."
47-
# exit 1
48-
# elif [ "$CONCLUSION" != "success" ]; then
49-
# echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
50-
# exit 1
51-
# fi
52-
# echo "Main build succeeded, proceeding with release"
45+
if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
46+
echo "Main build is still running (status: $STATUS). Cannot proceed with release."
47+
exit 1
48+
elif [ "$CONCLUSION" != "success" ]; then
49+
echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
50+
exit 1
51+
fi
52+
echo "Main build succeeded, proceeding with release"
5353
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
5454
with:
5555
java-version-file: .java-version

0 commit comments

Comments
 (0)