Skip to content

Commit 807ef5a

Browse files
committed
feat(ci): replace action with little script
since poseidon/wait-for-status-checks#383 apparently won't be addressed, this should implement that No checks aside from `IGNORED_JOBS` and `CURRENT_JOB` (self-ref loop) are allowed to be not `SUCCESS` or `SKIPPED`
1 parent fa4552c commit 807ef5a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/wait-for-checks.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ jobs:
1717
permissions:
1818
checks: read
1919
steps:
20-
- uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
21-
with:
22-
token: ${{ github.token }}
23-
ignore: generateDiffCommentBody,postDiffComment
20+
- env:
21+
GH_TOKEN: ${{ github.token }}
22+
PR_URL: ${{ github.event.pull_request.pull_request.url }}
23+
IGNORED_JOBS: generateDiffCommentBody,postDiffComment
24+
CURRENT_JOB: ${{ github.job }}
25+
timeout-minutes: 60
26+
run: |
27+
[[ "$RUNNER_DEBUG" == 1 ]] && set -x
28+
set -e
29+
set -o pipefail
30+
31+
until unfinished_jobs="$(gh pr checks "${PR_URL}" --json name,state | jq --arg ignored "$IGNORED_JOBS,$CURRENT_JOB" -e 'map(select(([.state] | inside(["SUCCESS", "SKIPPED"]) | not) and ([.name] | inside($ignored | split(",")) | not))) | (map("\(.name) (\(.state))") | join(", ") | stderr) | length == 0' 2>&1 >/dev/null)"; do
32+
echo "The jobs '$unfinished_jobs' are not (successfully) finished yet" >&2
33+
sleep 5
34+
done

0 commit comments

Comments
 (0)