Skip to content

Pass Semgrep inputs to the scan step through env - #46

Merged
rgarcia merged 1 commit into
mainfrom
hypeship/semgrep-step-env
Nov 14, 2026
Merged

rgarcia merged 1 commit into
mainfrom
hypeship/semgrep-step-env

Conversation

@rgarcia

@rgarcia rgarcia commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

The Run Semgrep step interpolated inputs.extra-configs and the PR base SHA directly into the shell script, which Semgrep's own run-shell-injection rule flags. Both now arrive through env:.

  • EXTRA_CONFIGS is still word-split, since callers pass flags like --config p/golang --config p/trailofbits. set -f stops a * in it from globbing. Word splitting doesn't evaluate ; or $(...), so a value can only add arguments to semgrep scan.
  • BASELINE_COMMIT is quoted.
  • test_semgrep_triage.py asserts the script has no ${{ }} and reads both values from env.

Tested: python -m unittest discover -s scripts -p test_semgrep_triage.py (25 pass), plus a shell check that the split keeps each flag and leaves *, ; and $(id) as literal arguments.

@rgarcia
rgarcia merged commit f1783f8 into main Nov 14, 2026
5 checks passed
@rgarcia
rgarcia deleted the hypeship/semgrep-step-env branch November 14, 2026 03:20
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