Skip to content

Commit 5795f29

Browse files
authoredFeb 21, 2025
Merge pull request #6127 from IntersectMBO/fix-gha-wait-for-hydra
fix `wait-for-hydra` for when there are too many check runs
2 parents 757f338 + 854ed96 commit 5795f29

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed
 

‎.github/workflows/release-ghcr.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Upload to ghci.io
1+
name: Upload to ghcr.io
22

33
on:
44
push:
@@ -28,17 +28,18 @@ jobs:
2828
- name: Waiting for ci/hydra-build:required to complete
2929
run: |
3030
while [[ true ]]; do
31-
conclusion=$(gh api repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs --jq '.check_runs[] | select(.name == "ci/hydra-build:required") | .conclusion')
31+
check_name='ci/hydra-build:required'
32+
conclusion=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?check_name=$check_name" --jq '.check_runs[].conclusion')
3233
case "$conclusion" in
3334
success)
34-
echo "ci/hydra-build:required succeeded"
35+
echo "$check_name succeeded"
3536
exit 0;;
36-
failure)
37-
echo "ci/hydra-build:required failed"
38-
exit 1;;
39-
*)
40-
echo "ci/hydra-build:required pending. Waiting 30s..."
37+
'')
38+
echo "$check_name pending. Waiting 30s..."
4139
sleep 30;;
40+
*)
41+
echo "$check_name terminated unsuccessfully"
42+
exit 1;;
4243
esac
4344
done
4445

‎.github/workflows/release-upload.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,21 @@ jobs:
2525
name: "Wait for hydra check-runs"
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Get specific check run status
28+
- name: Waiting for ci/hydra-build:required to complete
2929
run: |
3030
while [[ true ]]; do
31-
conclusion=$(gh api repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs --jq '.check_runs[] | select(.name == "ci/hydra-build:required") | .conclusion')
31+
check_name='ci/hydra-build:required'
32+
conclusion=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?check_name=$check_name" --jq '.check_runs[].conclusion')
3233
case "$conclusion" in
3334
success)
34-
echo "ci/hydra-build:required succeeded"
35+
echo "$check_name succeeded"
3536
exit 0;;
36-
failure)
37-
echo "ci/hydra-build:required failed"
38-
exit 1;;
39-
*)
40-
echo "ci/hydra-build:required pending. Waiting 30s..."
37+
'')
38+
echo "$check_name pending. Waiting 30s..."
4139
sleep 30;;
40+
*)
41+
echo "$check_name terminated unsuccessfully"
42+
exit 1;;
4243
esac
4344
done
4445

0 commit comments

Comments
 (0)