analyze: widen unescaped-${VAR} detector to scan the whole raw pipeline file #14

Merged
oleks merged 1 commits from fix/unescaped-var-whole-file-scan into main 2026-08-04 01:02:51 +03:00
Owner

Fixes oleks/pipetree#13

Adds a whole-raw-file scanning pass (findUnescapedVarsInFile) alongside the existing per-command scan for the UnescapedWoodpeckerVar footgun detector, so literal unescaped ${VAR} in step names/comments/environment values (outside any commands: string) are now caught too. Results are deduped against the existing per-command pass.

Includes a new test fixture (testdata/deals-comment-above-commands.yaml) reproducing the actual incident from the issue.

Fixes oleks/pipetree#13 Adds a whole-raw-file scanning pass (`findUnescapedVarsInFile`) alongside the existing per-command scan for the `UnescapedWoodpeckerVar` footgun detector, so literal unescaped `${VAR}` in step names/comments/environment values (outside any `commands:` string) are now caught too. Results are deduped against the existing per-command pass. Includes a new test fixture (`testdata/deals-comment-above-commands.yaml`) reproducing the actual incident from the issue.
oleks added 1 commit 2026-08-04 01:01:07 +03:00
analyze: widen unescaped-${VAR} detector to scan the whole raw pipeline file
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
38bf4c51ef
findUnescapedVars only walked parsed Commands strings, so a literal ${VAR}
in a step name, top-level comment, or environment: value - all outside any
commands: string - passed the check clean while Woodpecker's own ${VAR}
substitution pass (which runs over the entire raw pipeline YAML text, not
just command bodies) hard-failed the pipeline at compile time.

Add findUnescapedVarsInFile as a whole-file pass alongside the existing
per-command scan, deduped against it so nothing inside a commands: string
gets reported twice. Fixes oleks/pipetree#13, reproduced by a fixture
matching the actual incident: an explanatory comment above a step's
commands: block containing unescaped ${VAR} example text (oleks/deals
pipelines #12/#13, oleks/element-web-patched #5/#6).
oleks merged commit 81811b20a7 into main 2026-08-04 01:02:51 +03:00
oleks deleted branch fix/unescaped-var-whole-file-scan 2026-08-04 01:02:51 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oleks/pipetree#14