Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,13 @@ jobs:
# the previous step dispatched explicitly.
SHA=$(gh pr view "$PR_URL" --json headRefOid --jq .headRefOid)
for i in $(seq 1 40); do
RUNS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$SHA/check-runs" --jq .check_runs)
ALL=$(gh api "repos/$GITHUB_REPOSITORY/commits/$SHA/check-runs" --jq .check_runs)
# Keep only the newest run of each check name. A check can appear
# several times on one commit: autoupdate dispatches CI, then
# claude.yml dispatches it again, and pr-checks' concurrency group
# cancels the earlier one. Those cancelled leftovers are not a
# verdict on the code, but counting them lost a fully green PR.
RUNS=$(jq 'group_by(.name) | map(max_by(.id))' <<<"$ALL")
TOTAL=$(jq length <<<"$RUNS")
PENDING=$(jq '[.[] | select(.status != "completed")] | length' <<<"$RUNS")
[ "$TOTAL" -gt 0 ] && [ "$PENDING" -eq 0 ] && break
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ jobs:
# produces no check runs, so this view sees only jobs that really ran.
SHA=$(gh pr view "$PR_URL" --json headRefOid --jq .headRefOid)
for i in $(seq 1 40); do
RUNS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$SHA/check-runs" --jq .check_runs)
ALL=$(gh api "repos/$GITHUB_REPOSITORY/commits/$SHA/check-runs" --jq .check_runs)
# Keep only the newest run of each check name. A check can appear
# several times on one commit: autoupdate dispatches CI, then
# claude.yml dispatches it again, and pr-checks' concurrency group
# cancels the earlier one. Those cancelled leftovers are not a
# verdict on the code, but counting them lost a fully green PR.
RUNS=$(jq 'group_by(.name) | map(max_by(.id))' <<<"$ALL")
TOTAL=$(jq length <<<"$RUNS")
PENDING=$(jq '[.[] | select(.status != "completed")] | length' <<<"$RUNS")
[ "$TOTAL" -gt 0 ] && [ "$PENDING" -eq 0 ] && break
Expand Down
Loading