You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check-jsonschema: set nullglob and guard empty glob expansion #162
.github/actions/check-jsonschema/action.yml documents files as accepting "Space-separated files or shell globs" (line 9) and deliberately leaves $FILES unquoted so globs expand (line 70). But the Validate step never sets nullglob, so a glob matching nothing is passed through literally and reaches the tool as a filename:
OSError: ... '.github/workflows/*.yaml'
EXIT=1
Why it matters
This makes the documented glob support unsafe to use defensively. Concrete case from melodic-software/.github#29: GitHub accepts both .yml and .yaml for workflow files, so the correct-looking pattern is:
Today that crashes CI in every repo that has no .yaml workflow — which is most of them. Consumers are therefore forced to either hand-enumerate files (which drifts — that's the bug #29 fixes) or write a glob that only covers one of the two valid extensions.
Suggested fix
In the Validate step:
shopt -s nullglob before expansion, so unmatched patterns vanish rather than passing through.
Guard the total expansion: if nullglob leaves the argument list empty, fail with a clear message rather than invoking check-jsonschema with no files (which would otherwise silently pass and become a false-green).
Both halves are needed — (1) alone converts a crash into a silent no-op, which is worse.
Notes
Reported from a hygiene sweep on melodic-software/.github. Not urgent for that repo: all five of its workflows are .yml, so the gap is latent, not active. Filed because the fix belongs here, not in the consumer.
Activity
chore(ci): adopt the ci-status composite and bump check-jsonschema (#32)