Skip to main content
The workflow audit pack extends CodeGate’s static analysis with a dedicated set of checks for GitHub Actions workflows, action definitions, and Dependabot configuration. Enable it with --workflow-audits.
codegate scan . --workflow-audits

Checks

Supply chain

Detects unpinned external action references (uses: owner/repo@tag instead of a full commit SHA), archived action references, stale action refs, floating action version tags, and — in online mode — known-vulnerable action references from the advisory registry.

Dangerous triggers

Flags high-risk workflow trigger events: pull_request_target and workflow_run. These triggers run in the context of the base repository even when initiated by a fork, and can grant untrusted code write permissions if not carefully guarded.

Overly broad permissions

Reports write-all permission grants and explicit write grants on sensitive scopes. Also covers undocumented permissions blocks, overprovisioned secrets, secrets: inherit usage, and secrets referenced outside of environment blocks.

Template expression injection

Detects ${{ }} template expressions that interpolate untrusted context values (such as github.event.pull_request.title or github.head_ref) directly into run: steps or known sink inputs. Template injection is a common code-execution path in compromised workflows.

Dependabot checks

Cooldown checks flag Dependabot PRs merged before a configurable settling period. Execution-risk checks flag Dependabot configurations that allow auto-merge of updates with elevated execution risk. Auto-merge policy detection is also included.

Workflow hygiene

Covers concurrency gate absence (workflows that can run concurrent instances unexpectedly), obfuscation patterns in workflow definitions, unsafe conditional trust (if: conditions that can be bypassed), unsound contains() usage, bot-condition bypasses, and other hygiene signals.

Collection modes

The --collect flag controls which artifact scope is included for auditing. It is repeatable.
ValueDescription
defaultProject-level artifacts only, same as project. This is the default when --collect is not specified.
projectCollect workflows, actions, and Dependabot config from the scanned project.
userInclude user-level GitHub Actions configuration.
explicitOnly include paths explicitly provided on the command line.
allCollect from all available scopes.
codegate scan . --workflow-audits --collect project
codegate scan . --workflow-audits --collect project --collect user

Collection kinds

The --collect-kind flag restricts collection to specific artifact types. It is repeatable.
ValueDescription
workflowsGitHub Actions workflow files under .github/workflows/.
actionsAction definition files (action.yml / action.yaml).
dependabotDependabot configuration (.github/dependabot.yml).
codegate scan . --workflow-audits --collect-kind workflows
codegate scan . --workflow-audits --collect-kind workflows --collect-kind actions

Personas

The --persona flag adjusts audit sensitivity. Higher personas enable more checks.
ValueDescription
regularDefault. Runs checks suitable for everyday project review.
pedanticEnables additional checks that may produce more informational findings.
auditorEnables all checks, including low-signal hygiene findings. Suitable for formal security reviews.
codegate scan . --workflow-audits --persona auditor

Runtime modes

The --runtime-mode flag controls whether checks that require network access are enabled.
ValueDescription
offlineDefault. Only offline checks run. Known-vulnerable action lookups and other online-only checks are skipped.
onlineAll checks run, including those that perform live advisory lookups (known-vulnerable actions, archived actions, stale refs, impostor commit detection, ref/version mismatch).
online-no-auditsNetwork is available but audit-specific online checks are disabled.
codegate scan . --workflow-audits --runtime-mode online

Strict collection

Use --strict-collection to treat parse failures in collected workflow or action inputs as high-severity findings rather than silently skipping unparseable files:
codegate scan . --workflow-audits --strict-collection

Examples

Run the full audit pack on a project with online advisory lookups:
codegate scan . --workflow-audits --collect project --persona auditor --runtime-mode online
Audit only Dependabot configuration:
codegate scan . --workflow-audits --collect-kind dependabot
Audit workflows and action definitions in offline mode:
codegate scan . --workflow-audits --collect-kind workflows --collect-kind actions
Emit results as SARIF for upload to GitHub Code Scanning:
codegate scan . --workflow-audits --no-tui --format sarif --output codegate.sarif