chainsaw scan-actions
Scan GitHub Actions workflows for supply-chain risk
Scan GitHub Actions workflows for supply-chain risk
chainsaw scan-actions <path> [flags]
Scan one or more GitHub Actions workflow YAML files for supply-chain issues — unpinned refs, typosquats, unknown publishers, known-malicious actions, and dangerous trigger shapes: a pull_request_target/workflow_run job that checks out and runs the pull request head, a comment-triggered job with secrets or a publish step and no author_association guard, untrusted event text interpolated into a run: step, and a run: step that decodes a payload and executes it (echo <base64> | base64 -d | bash). A plain curl | sh installer is not flagged.
<path> may be either a directory (the command walks <path>/.github/workflows/) or a single workflow YAML file.
Known-malicious actions come from a built-in seed plus, when present, a GitHub Actions OSV snapshot (GHSA JSON files) in the github-actions-osv/ directory beside the guard cache. Nothing is fetched.
Output formats (–format, a global flag): text (the default), json, sarif. –json is sugar for –format=json. Every format honours –output.
Exit codes:
0 — no finding at or above –fail-on (lower findings are still reported)
1 — at least one finding at or above –fail-on, default high (suitable for
set -e CI gates; –fail-on medium also gates unpinned tag refs)
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--fail-on | string | high | Lowest finding severity that exits 1: high, medium or low |
The global flags apply here too.