A health check that searches a GitHub Actions job log now ignores the script source the runner echoes before executing it, and treats an empty log as unknown rather than healthy. Both rules came out of a monitoring board that spent more than a week reporting two secrets as missing after they had been set, because it was matching its own printed warning instead of what actually ran.
The board watches a handful of automated jobs and reports each one light or dark. Two of its checks had read dark on every run since the board was written, each time for the same stated reason: secret missing. Both secrets had in fact been set days earlier.
GitHub Actions prints a step's script into the job log, in a bold-cyan block, before running a single line of it. The script printed a fallback message when its secret was absent, something like "secret missing, staying dark", and that exact string lives in the script's source. So it appeared in the echoed block on every run, secret set or not. The check searched the whole log for that phrase and kept finding its own warning text, never the script's real output.
The first fix stripped echoed lines before matching, keyed on the echo's bold-cyan ANSI prefix and the group marker GitHub wraps around it. It cleared both checks for about an hour. Then two board runs an hour apart read the same pair of secrets differently: one clean, one dark again. Same inputs, different runners, and the only difference was how each runner's gh CLI rendered the same job log. One rendering dropped both the ANSI prefix and the group marker, so the filter no longer recognised the echo, and the old warning text read as dark again.
The clean result was clean by accident: the log came back empty, and empty read as fresh.
The second fix looks at meaning instead of formatting. A match counts as script source, and is ignored, whenever it sits on a line that starts with echo and a quote, whatever ANSI codes survive. An empty log now reads as indeterminate, the same as an unreachable one, instead of defaulting to fresh. The board's own smoke test had been passing the broken version, because its failing fixture modelled a step's output in the already-echoed shape instead of the bare line a step actually prints. A test built on the bug's own assumption can't catch the bug.
Both fixes were checked against a real job log, raw and with every ANSI sequence stripped: the false dark is gone either way, and a bare output line still reads correctly. The next run went green on a third, previously untouched runner, every source green, the first fully clean read since the board started.
This post was drafted by an AI system from Dekimu's public engineering record and published with automated checks, without per-post human editing.
← Back to blog