Skip to content

verify-action-build: diff and scan the shell payload actions ship - #1205

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:verify-diff-shell-sources
Open

verify-action-build: diff and scan the shell payload actions ship#1205
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:verify-diff-shell-sources

Conversation

@potiuk

@potiuk potiuk commented Aug 27, 2026

Copy link
Copy Markdown
Member

Code change

Summary

A node action can shell out to a script committed beside it, and nothing was reviewing that script.

  • The approved-vs-new source diff copied only .js/.ts/.mjs/.cjs/.mts/.cts/.json/.yml/.yaml, so .sh files and Dockerfile* never appeared in it.
  • analyze_scripts ran only for composite/docker actions, and only for scripts named in action.yml or a Dockerfile.

Surfaced by #1196 (uraimo/run-on-arch-action v3.2.0). Its action.yml declares main: src/run-on-arch.js, which exec()s src/run-on-arch.sh - so the reviewer was shown "only an action.yml description changed" while the upstream diff also carried src/run-on-arch.sh +12/-1 (five new bind-mounts of runner-writable paths into the container) and three new Dockerfiles/Dockerfile.*.

  • Add shell/interpreter extensions and Dockerfile* to the source diff (diff_source.py).
  • Discover committed shell scripts from the repo tree, reusing the JS discovery's directory filters (security.py).
  • Run script analysis for JS actions too (verification.py). Informational there: findings show in the summary but are not added to non_js_warnings, so a JS action's pass/fail verdict is unchanged.
  • README updated.

Type of change

  • Bug fix
  • Enhancement to existing code
  • Documentation update

Testing

  • uv run pytest utils/tests/ - 334 passed.
  • New test_diff_source.py covering the selection predicate, including suffixed-Dockerfile and not-a-Dockerfile precision cases.
  • New analyze_scripts regression tests: the run-on-arch shape (script reachable only from the JS entrypoint), vendored/test dir exclusion, sub_path scoping.

Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

The source diff only copied JS/TS/JSON/YAML, and script analysis ran only
for composite/docker actions and only for scripts named in action.yml or a
Dockerfile. A node action that shells out to a committed script therefore
had that script reviewed by nobody: uraimo/run-on-arch-action declares
main: src/run-on-arch.js, which exec()s src/run-on-arch.sh, so PR apache#1196's
+12/-1 change to its docker run invocation never reached the reviewer.

Add shell/interpreter extensions and Dockerfile* to the source diff,
discover committed scripts from the repo tree, and run script analysis for
JS actions too (informational there - the verdict is unchanged).

Generated-by: Claude Code (Opus 5)
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