Skip to content

Commit 7a53711

Browse files
authored
Merge pull request #9 from nsheaps/fix/running-ci-emoji
fix: show running CI as 🟡 when non-required checks still in progress
2 parents a536d7f + a03a1a1 commit 7a53711

2 files changed

Lines changed: 40 additions & 11 deletions

File tree

.github/workflows/test.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Check bash syntax
16+
run: |
17+
for script in bin/*; do
18+
[[ -d "$script" ]] && continue
19+
echo "Checking $script..."
20+
bash -n "$script"
21+
done
22+
echo "All scripts passed syntax check."
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Setup mise
30+
uses: jdx/mise-action@v2
31+
32+
- name: Run tests
33+
run: mise run test

bin/gs-stack-status

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -430,25 +430,21 @@ if [[ -n "$repo_owner" && ${#pr_number_to_branch[@]} -gt 0 ]]; then
430430
else $valid
431431
end) as $filtered |
432432
433-
# CheckRun nodes: running if status exists and != COMPLETED
434-
($filtered | map(select(
435-
.status != null and .status != "COMPLETED"
436-
)) | length) as $cr_running |
437-
# CheckRun nodes: failed conclusions
433+
# any_running: use ALL checks (not just filtered/required) so
434+
# non-required in-progress checks keep overall status as pending
435+
(([$valid[] | select(
436+
(.status != null and .status != "COMPLETED") or
437+
(.cState != null and (.cState | IN("PENDING", "EXPECTED")))
438+
)] | length) > 0) as $any_running |
439+
# Failed: only from filtered (required) checks
438440
($filtered | map(select(
439441
.conclusion != null and
440442
(.conclusion | IN("FAILURE", "TIMED_OUT", "ERROR", "STARTUP_FAILURE", "ACTION_REQUIRED"))
441443
)) | length) as $cr_failed |
442-
# StatusContext nodes: running (PENDING/EXPECTED)
443-
($filtered | map(select(
444-
.cState != null and (.cState | IN("PENDING", "EXPECTED"))
445-
)) | length) as $sc_running |
446-
# StatusContext nodes: failed
447444
($filtered | map(select(
448445
.cState != null and (.cState | IN("FAILURE", "ERROR"))
449446
)) | length) as $sc_failed |
450447
451-
(($cr_running + $sc_running) > 0) as $any_running |
452448
(($cr_failed + $sc_failed) > 0) as $any_failed |
453449
454450
if $any_running and $any_failed then

0 commit comments

Comments
 (0)