Skip to content

docs: recommend safe JSON consumption of changed files to prevent argument injection - #2884

Open
somaz94 wants to merge 1 commit into
tj-actions:mainfrom
somaz94:docs/safe-changed-files-consumption
Open

docs: recommend safe JSON consumption of changed files to prevent argument injection#2884
somaz94 wants to merge 1 commit into
tj-actions:mainfrom
somaz94:docs/safe-changed-files-consumption

Conversation

@somaz94

@somaz94 somaz94 commented Jun 16, 2026

Copy link
Copy Markdown

Documents the recommended pattern for safely forwarding the list of changed files to another command: consume the JSON output (json: true, escape_json: false) into a bash array with jq/mapfile and pass it after the -- end-of-options separator. Without this, a file whose name starts with - (e.g. --config=evil.cjs) can inject options into the downstream command and lead to code execution in CI.

  • Adds a "Safely consume the list of changed files (recommended)" example to the Examples section.
  • Adds an argument-injection caveat to the Important Notice section, alongside the existing spaces-in-filenames note.

Validation:

  • <details> / code-fence balance preserved.
  • Embedded bash snippet passes shellcheck -S style (clean).
  • Edits are outside the AUTO-DOC managed regions, so auto-doc will not conflict.

related: #2880

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@somaz94
somaz94 marked this pull request as ready for review June 16, 2026 07:06
somaz94 added a commit to somaz94/somaz94 that referenced this pull request Jun 16, 2026
@somaz94

somaz94 commented Jul 8, 2026

Copy link
Copy Markdown
Author

Just a friendly ping 🙂 — this has been green and awaiting review for about 3 weeks now. Happy to rebase or address any feedback whenever a maintainer has a chance to take a look. Thanks for maintaining this project!

@somaz94

somaz94 commented Aug 10, 2026

Copy link
Copy Markdown
Author

@jackton1 — following up on my 8 Jul note and correcting it: I said this had been green for about three weeks, which wasn't accurate. There are zero workflow runs on this PR; the only checks are Codacy and GitGuardian, which are third-party apps reporting independently of the repo's own CI. Fork PRs from April onward all show zero runs, while in-repo PRs get the full 8.

That said, this one is docs-only (+31/−0, README.md alone), so the missing CI isn't material here — it just needs a read. It documents consuming the changed-files JSON outputs safely to avoid argument injection.

Would you have a moment to take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant