Skip to content

Composite action run: blocks are not ShellCheck-covered by the actionlint lane #167

Closed

Description

@kyle-sexton

Problem

The actionlint lane lints workflow files. It does not lint composite action.yml files — passing one explicitly makes actionlint parse it as a workflow and emit "jobs" section is missing.

Consequence: no composite action's run: block in this repo has ever been ShellCheck-covered. Every composite under .github/actions/*/action.yml contains bash that has never been statically analyzed by CI.

Evidence this is not theoretical

Two real bugs shipped in composite run: blocks and were found by review rather than by CI, both in the last day:

  1. check-jsonschema: set nullglob and guard empty glob expansion #162 — check-jsonschema passed unmatched globs through literally because nullglob was never set, crashing the tool. Fixed in fix(check-jsonschema): set nullglob and fail on empty glob expansion #165. That PR also cleared a pre-existing SC2086 in the same block — a finding ShellCheck would have raised immediately had the file been covered.
  2. feat(ci-status): extract the lane-aggregation loop into a composite #164 (ci-status) — read -ra results <<< "$RESULTS" consumed only the first line of a whitespace-separated input, so a caller passing a YAML block scalar had every lane after line one silently unchecked. The gate reported success while a lane had failed. Found by Codex review, not by CI.

The second is the more alarming shape: a false green on the job that gates every merge.

Why the existing lanes miss it

  • actionlint — parses action.yml as a workflow and errors out rather than linting it; composites are effectively invisible to it.
  • shellcheck lane — targets .sh files; shell embedded in YAML run: blocks is not extracted.
  • lefthook pre-commit — same file-extension scoping.

So the gap is structural, not a misconfiguration of any one lane.

Possible directions (not a recommendation — needs the usual selection pass)

  • Extract each composite's run: block and pipe it through ShellCheck in CI. Extraction must be verbatim, and the check should fail if extraction yields nothing, or it becomes its own false green.
  • Evaluate whether a maintained upstream tool already does this before hand-rolling extraction — worth checking actionlint's issue tracker for composite-action support, and whether any community action covers action.yml shell linting.
  • Consider whether the shell in composites should live in .sh files the composite invokes, which would bring it under the existing shellcheck lane with no new tooling. This trades a file indirection for real coverage and may be the smaller change.

Whichever direction: the acceptance test is that a deliberately broken run: block in a composite fails CI. Verify by introducing one, not by observing a green run.

Notes

Surfaced while implementing #162 (see #165). Not fixed there — out of scope for that change, and it warrants its own selection pass rather than being bolted on.


Work-class: C3 (bug-fix-shaped) — attended triage 2026-07-23, operator-ratified. 🤖

Activity

  1. added
    agent-ready
    on Jul 23, 2026
  2. kyle-sexton commented on Jul 24, 2026

    @kyle-sexton
    MemberAuthor

    First-drain C3 ratification request (work-loop admission gate, fail-closed).

    • Classification: C3 scoped, bug-fix-shaped (per attended triage 2026-07-23 body stamp).
    • first_drain_complete is not set and this item carries no recorded dispatch ratification, so the gate queues it instead of dispatching.
    • Intended dispatch on ratification: work the ShellCheck-coverage gap for composite action.yml run: blocks per the issue's selection pass — evaluate upstream/actionlint support and the extract-vs-relocate-to-.sh options, implement the selected direction, acceptance test = a deliberately broken run: block fails CI.

    To ratify: reply on this comment per /work-items:attend-queue's ratification flow, then remove the needs-human label — the item returns to the autonomous frontier and dispatches on a later cycle.

    This comment was written by an AI agent (work-items:work-loop lane).

  3. added
    needs-human
    on Jul 24, 2026
  4. kyle-sexton commented on Jul 24, 2026

    @kyle-sexton
    MemberAuthor

    Ratified (attended queue, 2026-07-24): operator ratified the first-drain C3 dispatch as marked — evaluate actionlint embedded-shell support vs extract-to-.sh, implement selected direction, acceptance = deliberately broken run: block fails CI. Returning to the autonomous frontier. This comment was written by an AI agent on the operator's behalf (work-items:attend-queue lane).

  5. added and removed
    needs-human
    on Jul 24, 2026
  6. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    Provenance record: the work-class: label on this issue was applied by an AI agent at the operator's explicit direction during an attended queue session (2026-07-26), mapping the operator-ratified Work-class: body trailer onto the live label set. Recorded because, under the shared gh identity, an agent-written class label is otherwise indistinguishable from an operator-written one — and the merge-admission gate reads this label.

    This comment was written by an AI agent (work-items:attend-queue lane).

  7. self-assigned this
    on Jul 26, 2026
  8. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  9. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by an AI agent (work-items:work-loop lane).

    Branch chore/167-composite-action-run-blocks-are-not-shel pushed (2 commits). Selection pass, implementation, and the acceptance-test evidence below.

    Selection pass

    No upstream or community tool covers this. Verified against primary sources:

    • actionlint (latest 1.7.12, 2026-03-30) has no action.yml input mode. Its own docs/checks.md states verbatim that steps in a composite action's metadata "is not checked at this point." rhysd/actionlint#46 has been open since 2021-09; PR #366 implements it but is unmerged pending an architecture decision the maintainer has not made.
    • zizmor (1.28.0) parses action.yml but its entire audit catalog is security-classed — no shell-quality check.
    • action-validator does JSON-schema shape only. reviewdog/action-actionlint wraps actionlint and inherits the limitation. ludeeus/action-shellcheck is unmaintained (last push 2024-06) and has no YAML extraction. ShellCheck itself has no YAML awareness.

    Extraction was selected over relocating shell into .sh files.

    The decisive argument is this issue's own acceptance test. Relocation moves today's shell out of run: blocks; it does nothing about a run: block. A deliberately broken block would still not fail CI. Relocation plus a structural guard would fail CI on a broken block — but equally on a correct one, because it detects inline-ness, not brokenness. The bug shape #164 cites is ShellCheck-detectable, and the acceptance test wants ShellCheck to be the thing that catches it.

    Two further points against relocation: it churns 16 behavioral files, and the "8 of 24 already relocated" pattern is not a migration in progress — nearly every relocated script here pairs with a unit test (run.test.sh, scan.test.sh, guard.test.sh). The repo's actual idiom is inline for thin argument marshalling, .sh when it needs unit tests.

    Extraction also has a property relocation lacks: it covers future inline blocks automatically, and it makes the # shellcheck disable= directives already present in ci-status and check-jsonschema take effect. Those were written as if covered.

    Implementation

    .github/scripts/composite-run-shellcheck.sh, wired into ci.yml's existing actionlint job (which already has the pinned ShellCheck on PATH). Repo-internal rather than a published action: making it a consumer-facing contract would mean README surface, a tool-version-drift-check entry for a newly pinned tool, and a default-on-breaks-consumers decision. yq comes from the runner image, matching tool-version-drift-check.yml's existing bare use.

    It reproduces actionlint's exact ShellCheck contract for embedded scripts, read from rule_shellcheck.go: --norc -x, the set -eo pipefail / set -e prologue GitHub itself runs the step with, equal-length underscore substitution of ${{ }}, and the seven excluded codes. Every exclusion is a false positive of the artifact class — env: injection, unresolvable sources, constants produced by the substitution — not a relaxation of shell policy. A composite step is therefore judged identically to the same step in a workflow, rather than under a ruleset written for standalone scripts.

    Three false-green guards, since a selector matching nothing is also green:

    1. Per action, the count extracted must equal an independently computed count of bash/sh blocks.
    2. Overall, extracting zero blocks fails.
    3. Every tracked composite must appear by name in the output, so discovery reaching one action instead of all of them fails.

    Steps ShellCheck cannot analyse — the two pwsh blocks in powershell — are announced, never silently dropped.

    Findings surfaced

    15 SC2086 across 13 actions. Every one is the deliberate unquoted expansion already documented in place ("$PATHS unquoted so multiple targets word-split"). Each got a directive at the site rather than a blanket exclusion — SC2086 is precisely the check that would have caught #162. Converting them to arrays would change 13 actions' argument marshalling and is a separate decision, not this one.

    Coverage: 33 bash blocks across 22 actions, previously linted by nothing.

    Acceptance test — verified by breaking it, not by reading config

    Injected the #164 regression shape into the real ci-status block — the gate that decides every merge:

    In .github/actions/ci-status/action.yml.step-0.bash line 21:
    for r in ${results[@]}; do
             ^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements.
    LANE EXIT=1
    

    Restored byte-identical. Per this repo's convention (see #251), the breakage is also pinned permanently rather than only demonstrated: composite-run-shellcheck.test.sh asserts a broken block fails, that the ${{ }} substitution ran, that the pwsh skip is announced, that every tracked composite is reached, and that a file set yielding no block fails rather than passing empty.

    Independent review caught three real defects

    Routed to a fresh-context reviewer with the rationale withheld. It found:

    1. The script failed the comment-hygiene required lane. Its header cited rhysd/actionlint#46, matching the owner/repo#N tracker-ref pattern. It scanned clean while the file was untracked — that lane uses git-tracked discovery — so the violation only appeared once staged. Fixed.
    2. The substitution assertion proved nothing. It assumed an unsubstituted expression is a fatal parse error. It is not — ShellCheck reports SC2296 and continues, so the assertion passed either way, and since no real action.yml interpolates inline, the substitution had no test at all. Now asserts SC2296 is absent.
    3. One SC2086 directive was a blanket exclusion over an if compound in typos, covering both branches. Split per site.

    Both new assertions are mutation-verified: making the sanitizer a passthrough fails on SC2296; narrowing the discovery glob to one action fails the coverage floor.

    Recommended follow-up (not filed — out of scope here)

    The identical gap exists for the two shell: pwsh blocks in .github/actions/powershell/action.yml: PSScriptAnalyzer does not see them either, and this check announces them as skipped. Same shape as this issue, different analyzer. Worth its own item.

    Separately: consumers of .github/actions/actionlint still have no composite coverage, since this landed as a repo-internal check. Publishing it would need a checksum-pinned yq and a decision on default-on.

  10. added 3 commits that reference this issue on Jul 26, 2026
    232e16b
    d0a37b9
    9416a0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-ready

Type

Fields

No fields configured for Task.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions