Repository navigation
fix(generate): group consecutive >> redirects in generated shell (SC2129) - #704
Merged
Merged
Conversation
…129)
shellcheck flags SC2129 in the shell the orchestrate and promote generators
emit: several separate >> redirects to the same file, for example
$GITHUB_OUTPUT and $GITHUB_STEP_SUMMARY. CI's actionlint never showed them
because its installs lack shellcheck, so the workflow-lint and cli-install
selftest lanes carried -e SC2129 exclusions to mask the generator style.
The orchestrate summary step's header lines, callback rows, and outputs
header are consecutive writes to $GITHUB_STEP_SUMMARY, so they now collapse
into one { ...; } >> group; the per-output table-header pair gets its own
group. The promote release-data step's three $GITHUB_OUTPUT writes group per
branch. Only consecutive redirects to the same file are regrouped: the
per-output rows and the no-outputs notice keep their single redirects, and
the written bytes and statement order are unchanged. The dogfooded
orchestrate.yaml and promote.yaml are regenerated onto the new style, the
byte-identical goldens are refreshed, and the two CI exclusions are dropped
so SC2129 is enforced. actionlint v1.7.12 with shellcheck now passes over
.github/workflows and the regenerated goldens with no exclusion.
Closes #700
Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
Review of the #700 change found no defects in the grouping itself; this commit closes the accuracy and coverage gaps it did find. The env-gate actionlint test disabled shellcheck citing SC2129 nits in the generated run bodies; those bodies now group their redirects, so the flag is dropped and the test enforces the shellcheck cleanliness of the emitted orchestrate and promote workflows wherever shellcheck is installed (the hermeticity-motivated disable in runActionlint stays, with its stale SC2129 wording removed). A new test pins the summary group's shape for a manifest with no callbacks and no outputs, where folding the closing brace into the outputs conditional would emit an unterminated { that no golden covers. Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
joshua-temple
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
shellcheck flags SC2129 in the shell the orchestrate and promote generators emit: three or more separate
>>redirects to the same file, such as$GITHUB_OUTPUTor$GITHUB_STEP_SUMMARY. CI never reported it because the workflow-lint and cli-install selftest lanes pass-e SC2129to actionlint. (The first commit's message says CI's actionlint installs lack shellcheck. That's wrong: shellcheck is on the runners, and the exclusions are what hid it.)What changed
$GITHUB_STEP_SUMMARY. They now go out as one{ ...; } >> "$GITHUB_STEP_SUMMARY"group, and the per-output table header gets its own group. The per-output rows and the no-outputs notice keep their single redirects.$GITHUB_OUTPUTwrites are grouped where they stand.orchestrate.yamlandpromote.yamlare regenerated. The two-e SC2129exclusions are removed, so CI now enforces it. A shellcheck disable inenv_gate_reusable_test.gois removed too, so that test now checks the grouped output.One SC2129 site is left: the
release_id/release_url/html_urlwrites in the manage-release composite action's inline script (internal/generate/actions.go). It belongs to the shared action emitter, not the two generators this issue covers, and no CI lint reads composite action scripts.How it's tested
go test ./...with actionlint and shellcheck on PATH, so the actionlint feature-matrix and field-registry tests run instead of skipping. New tests pin the grouping, including the summary step with no outputs..github/workflowsis clean, and the regenerated goldens have no SC2129 findings.Closes #700