fix: push_code_samples_only handling, various injection preventions - #309
Open
bflad wants to merge 1 commit into
Open
fix: push_code_samples_only handling, various injection preventions#309bflad wants to merge 1 commit into
bflad wants to merge 1 commit into
Conversation
TristanSpeakEasy
approved these changes
Feb 25, 2026
Contributor
|
|
Adds actionlint to the CI test matrix and resolves all issues it
surfaces, plus a few that were independently identified.
## actionlint job (test.yaml)
A new `actionlint` job runs on every push/PR to lint all workflow
files for shellcheck violations, script injection risks, and
undefined inputs. The linter is installed via `go install
github.com/rhysd/actionlint/cmd/actionlint@v1.7.11` per the
tool's recommended CI setup. Uses `go-version-file: go.mod` for
toolchain consistency and declares `permissions: contents: read`
per least-privilege hygiene.
## Script injection fixes (workflow-executor.yaml, sdk-test.yaml)
GitHub Actions expressions in `run:` scripts are interpolated
before the shell parses the script, making them injection vectors.
Five values were moved from inline interpolation to step-level
`env:` variables so the shell sees them as safe environment
variable references rather than literal text:
- `github.event.pull_request.body` → `$PR_BODY` (attacker-
controlled: PR body content)
- `github.event.head_commit.message` → `$HEAD_COMMIT_MESSAGE`
(attacker-controlled: commit message content)
- `github.event.label.name` → `$LABEL_NAME` and
`github.event.action` → `$EVENT_ACTION` (label name is set by
anyone with label-apply access; action is low-risk but fixed for
consistency)
- `inputs.env_vars` → `$ENV_VARS` (workflow_call input; requires
caller control, fixed for consistency)
## Shell quoting and glob fixes (SC2086, SC2035, SC2059)
- Unquoted `$GITHUB_OUTPUT` and `$GITHUB_ENV` redirections quoted
throughout to prevent word splitting (SC2086)
- Unquoted `$TARGET` and `$BINARY_PATH` in bun build commands
quoted (SC2086)
- `*.nupkg` → `./*.nupkg` to prevent glob matching filenames
starting with `-` being treated as flags (SC2035)
- `*.gemspec` / `*.gem` → `./*.gemspec` / `./*.gem` (SC2035)
- `printf "...${VAR}..."` → `printf '...' "${VAR}"` to prevent
the variable from being interpreted as a format string (SC2059)
## Workflow input fixes (workflow-executor.yaml)
- `inputs.push_code_samples` → `inputs.push_code_samples_only`:
the workflow input was always named `push_code_samples_only`; the
wrong name silently evaluated to empty string, so the option was
never passed through
- `inputs.output_tests` removed: this action input exists but was
never wired as a workflow_call input, so the reference was always
empty; removed to eliminate dead configuration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bflad
force-pushed
the
chore/actionlint-workflow-fixes
branch
from
February 25, 2026 11:53
8c8196b to
d4d9092
Compare
danielkov
approved these changes
Feb 25, 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.
Summary
actionlintCI job to lint all workflow files on every push/PRrun:scriptsworkflow-executor.yaml(push_code_samplestypo, deadoutput_testsreference)actionlint job (test.yaml)
A new
actionlintjob runs on every push/PR to lint all workflowfiles for shellcheck violations, script injection risks, and
undefined inputs. The linter is installed via
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.11per thetool's recommended CI setup. Uses
go-version-file: go.modfortoolchain consistency and declares
permissions: contents: readper least-privilege hygiene.
Script injection fixes (workflow-executor.yaml, sdk-test.yaml)
GitHub Actions expressions in
run:scripts are interpolatedbefore the shell parses the script, making them injection vectors.
Five values were moved from inline interpolation to step-level
env:variables so the shell sees them as safe environmentvariable references rather than literal text:
github.event.pull_request.body→$PR_BODY(attacker-controlled: PR body content)github.event.head_commit.message→$HEAD_COMMIT_MESSAGE(attacker-controlled: commit message content)github.event.label.name→$LABEL_NAMEandgithub.event.action→$EVENT_ACTION(label name is set by anyone with label-apply access; action is low-risk but fixed for consistency)inputs.env_vars→$ENV_VARS(workflow_call input; requires caller control, fixed for consistency)Shell quoting and glob fixes (SC2086, SC2035, SC2059)
$GITHUB_OUTPUTand$GITHUB_ENVredirections quoted throughout to prevent word splitting (SC2086)$TARGETand$BINARY_PATHin bun build commands quoted (SC2086)*.nupkg→./*.nupkgto prevent glob matching filenames starting with-being treated as flags (SC2035)*.gemspec/*.gem→./*.gemspec/./*.gem(SC2035)printf "...${VAR}..."→printf '...' "${VAR}"to prevent the variable from being interpreted as a format string (SC2059)Workflow input fixes (workflow-executor.yaml)
inputs.push_code_samples→inputs.push_code_samples_only: the workflow input was always namedpush_code_samples_only; the wrong name silently evaluated to empty string, so the option was never passed throughinputs.output_testsremoved: this action input exists but was never wired as a workflow_call input, so the reference was always empty; removed to eliminate dead configurationTest plan
actionlintCI job passes on this PRbuildCI job passes on this PRactionlintruns cleanly locally:actionlint -color🤖 Generated with Claude Code