actionlint and zizmor are open-source static analysers for GitHub Actions workflow files, and running them on every pull request catches script injection, over-scoped tokens, unpinned actions and broken workflow syntax before a change reaches the default branch. This guide explains what each tool checks, how to configure and run it in CI, how to keep suppressions under control, and where static analysis stops and runtime controls have to take over.
GitHub Actions workflows are code that runs with credentials. Every job receives a GITHUB_TOKEN, many jobs read repository or environment secrets, and some federate to cloud providers through OIDC. A one-line mistake in a workflow can hand those credentials to anyone who can open an issue or a pull request. Static analysis makes those mistakes visible in review. For the broader control set, including runners, secrets and organisation settings, read our GitHub and GitHub Actions Security Guide; this page focuses only on the two analysers.
The tools are covered in alphabetical order, each in its own section. They are maintained by different open-source projects, are both MIT licensed, and many teams run both. This guide does not rank them.
Key takeaways
- Workflow files deserve the same review gate as application code, because they decide which code runs with which credentials.
- actionlint is a static checker for workflow files: syntax, strong type checks on
${{ }}expressions, action inputs and outputs, reusable workflows, shellcheck and pyflakes onrun:scripts, and security checks for script injection and hard-coded credentials. - zizmor is a static analysis tool for CI/CD that audits GitHub Actions workflows and actions, Dependabot and pre-commit configuration for issues such as template injection, credential persistence, excessive permissions, dangerous triggers, unpinned actions and impostor commits.
- Both tools signal findings through exit codes, so either can block a merge. Check each tool's exit code table before wiring a gate, particularly when SARIF output is enabled.
- Every ignore pattern or ignore comment is a recorded risk decision. Keep them narrow, explained and reviewed.
- The analysers' own installation and any token you give them are part of your supply chain. Pin versions and give tokens read-only scope.
- Static analysis sees definitions, not runtime state. Pair it with least-privilege token settings, SHA pinning and runner isolation.
What workflow static analysis covers
Workflow risks fall into a few families, and most of them are visible in the YAML:
- Injection. Template expansions in
${{ }}are substituted before a step runs, so attacker-controlled values such as an issue title or a commit message can become shell code. Our GitHub Actions Script Injection Guide explains the mechanics. - Credential exposure. Tokens persisted to disk by checkout, broad
GITHUB_TOKENpermissions, wholesecretscontexts passed to jobs, and blanket secret inheritance into reusable workflows. - Dangerous triggers. Events such as
pull_request_targetandworkflow_runthat run with the target repository's privileges while being triggerable from forks. - Dependency integrity. Actions referenced by branch or tag, which can change under you, and commit SHAs that look pinned but come from a fork.
- Correctness. Misspelled keys, wrong action inputs, undefined matrix properties and invalid cron or glob syntax. These are not always security bugs, but a filter that silently never matches can disable a protective workflow.
Mapped to frameworks, these risks sit under MITRE ATT&CK T1677, Poisoned Pipeline Execution, and T1195.002, Compromise Software Supply Chain, and under the OWASP Top 10 CI/CD Security Risks. The rest of this guide covers how each tool addresses them.
actionlint
actionlint describes itself as a static checker for GitHub Actions workflow files. Its project documentation states that it focuses on finding mistakes, trying to catch as many errors as possible while keeping false positives to a minimum. It is written in Go, can be used as a Go library, and runs in a browser through an online playground built on WebAssembly.
What it checks
- Syntax against GitHub's workflow syntax, reporting unexpected or missing keys. A
branch:key underpush, wherebranchesis expected, is reported rather than silently ignored. - Strong type checks for expressions, catching access to properties that do not exist and type mismatches, such as a matrix property that is never defined.
- Action usage, checking that inputs under
with:and outputs insteps.{id}.outputsare correct for the action used. - Reusable workflows, checking inputs, outputs and secrets of reusable workflows and workflow calls.
- Script checks through shellcheck and pyflakes integrations for
run:blocks. - Security checks for script injection by untrusted inputs and for hard-coded credentials. Its documented example flags
github.event.head_commit.messageused directly in an inline script as potentially untrusted and advises passing it through an environment variable. - Other checks, including glob syntax validation,
needs:dependencies, runner labels and cron syntax.
Configuration
Configuration is optional. When used, the file is actionlint.yaml or actionlint.yml in the .github directory, and actionlint -init-config generates a starting file. It supports three settings:
self-hosted-runner.labelslists your self-hosted runner labels, with glob patterns, so they are not reported as unknown.config-variableslists repository or organisation configuration variables. When set,varsproperties are checked strictly; an empty array allows none, and the defaultnulldisables the check.pathsmaps file globs toignorelists of regular expressions. A matching pattern filters out errors by message for those files only.
The command line -ignore option also filters errors by message using a regular expression and can be repeated. Prefer the path-scoped file setting, because it is committed, reviewable and limited to named files, whereas a command line pattern in a CI step applies to every workflow the step checks.
Running it in CI
With no arguments, actionlint detects workflows in the repository and checks them. Installation options include release binaries, Homebrew, go install, a download script intended for CI, and an official Docker image that bundles dependencies such as shellcheck. The -shellcheck and -pyflakes options set paths to those executables, and an empty value disables each integration.
Output is shaped with -format using Go template syntax, which supports JSON, JSON Lines, Markdown, GitHub error annotations and a SARIF template shipped in the project's test data. The documentation suggests Problem Matchers or reviewdog for pull request annotations, and reviewdog publishes an actionlint action.
Exit statuses are: 0 when no problem was found, 1 when problems were found, 2 for an invalid command line option and 3 for a fatal error. A gate that fails on any non-zero status therefore fails on both findings and tool errors, which is the safe default.
Two hardening points apply to the documented quick starts. The CI examples pipe a download script from the project's main branch into bash, and the Docker example uses the latest tag. In production pipelines, pin a specific release, verify its checksum or reference the image by digest, and update deliberately.
zizmor
zizmor describes itself as a static analysis tool for CI/CD systems that can find and fix security issues in GitHub Actions, Dependabot and pre-commit setups. Its documentation lists each audit with the input types it applies to, the version that introduced it, whether it works offline, whether auto-fixes are available and whether it is configurable.
Audits that matter most for credentials
template-injectiondetects code injection through template expansion inrun:and similar blocks. The documented remediation is to move the expansion into an environment variable.excessive-permissionsdetects over-scoped permissions at workflow and job level, including workflows that set none and inherit broad defaults. The documentation recommends declaring permissions minimally and close to where they are used, withpermissions: {}at workflow level.artipackeddetects git credentials persisted on disk byactions/checkoutand ways they can leak into artifacts. The remediation ispersist-credentials: falseunless git operations need the credential. Our breach analysis of ArtiPACKED 2024 shows what this looks like in practice.dangerous-triggersflagspull_request_target,workflow_runand, from v1.31.0,issue_comment. The documentation warns that avoiding execution of pull request code is not enough to make these triggers safe.unpinned-usesdetectsuses:clauses not pinned by SHA. From v1.20.0 the default policy requires hash pinning for all actions, including first-party ones. See How to Pin GitHub Actions to Commit SHAs.impostor-commitdetects pinned commits that exist only in a fork network, not in the repository named. The documentation notes these are visually indistinguishable from legitimate pins.secrets-inherit,overprovisioned-secrets,github-env,cache-poisoningandknown-vulnerable-actionscover blanket secret inheritance, passing the wholesecretscontext, dangerous writes toGITHUB_ENVandGITHUB_PATH, cache poisoning primitives, and actions with published advisories.
Personas
zizmor has three personas. The regular persona, the default, aims for high-signal, low-noise findings suitable for most CI. The pedantic persona (--persona=pedantic or --pedantic) adds code smells, for example every template expansion in a run: block. The auditor persona (--persona=auditor) flags everything, including likely false positives, for manual review. A sensible pattern is regular in the merge gate and auditor during periodic manual reviews.
Online mode and its token
zizmor runs offline unless a token is present in GH_TOKEN, GITHUB_TOKEN or ZIZMOR_GITHUB_TOKEN, or passed with --gh-token; ZIZMOR_OFFLINE or --offline forces offline mode. Some audits, such as impostor-commit and known-vulnerable-actions, need online access. The documentation states the token is used mainly to authenticate rate-limited API requests and needs no special permissions, except contents: read in GitHub Actions, or an appropriate repository scope, when auditing private repositories or private action references. Treat it as a non-human identity: give it read-only scope and never reuse a deploy or release token.
Ignores, fixes, output and exit codes
Findings can be suppressed inline with # zizmor: ignore[rulename], optionally followed by an explanation, or in a zizmor.yml file listing files with optional line and column for each rule. A file can also be passed with --config. --no-ignores disables all ignores, which is useful when reviewing another team's triage.
--fix or --fix=safe applies safe auto-fixes; --fix=all and --fix=unsafe-only include unsafe fixes, which the documentation says must be reviewed manually. Fixes modify files in place and do not apply to remote inputs.
Output formats include the default plain diagnostics, versioned JSON, SARIF and GitHub annotations, and --min-severity and --min-confidence filter results. Exit code 0 means no findings; 1 is an audit error, 2 an argument error and 3 no inputs collected; codes 11 to 14 report the highest finding level from informational to high. With --format=sarif or --no-exit-codes, or when all findings are auto-fixed, the codes from 11 upward are not used. If you upload SARIF, enforce the gate from the SARIF results or a second run, because the exit code alone will not fail the job on findings.
Running both in one pipeline
Many teams run both tools as separate steps in one workflow that triggers on pull requests touching .github/. A reference arrangement, offered here as an NHI Mgmt Group suggestion, looks like this:
- Trigger on
pull_request, notpull_request_target, so the job runs without the target repository's secrets. - Set
permissions: {}at workflow level and grantcontents: readto the job; addsecurity-events: writeonly to a job that uploads SARIF. - Check out with
persist-credentials: false. - Install each tool at a pinned version with checksum or digest verification, and pin any wrapping action to a full commit SHA.
- Run actionlint with the committed
.github/actionlint.yaml, failing on any non-zero exit status. - Run zizmor with the committed
zizmor.yml, in online mode with a read-only token where impostor and advisory audits are wanted, failing on the exit code threshold you choose. - Require the job as a status check in branch protection or rulesets so a failing scan blocks merge.
Add a scheduled run across all repositories in the organisation. New audits ship in new releases, and a scheduled run with the latest pinned version finds issues in workflows nobody has edited recently.
Governing suppressions
Both tools let you suppress findings, and suppressions are where workflow security quietly decays. Practical rules:
- Scope every suppression to a file, and for zizmor to a line where possible. Avoid regular expressions in actionlint
ignorelists that match whole categories of messages. - Require a reason. zizmor ignore comments accept trailing text; for actionlint, put the reason in a YAML comment beside the pattern.
- Make changes to
actionlint.yaml,zizmor.ymland inline ignore comments require review from a code owner in the security team. - Periodically rerun zizmor with
--no-ignoresand the auditor persona to see the unfiltered picture. - Report false positives upstream rather than suppressing them permanently; both projects ask for minimal reproducing examples.
Limits of static analysis
zizmor's documentation is explicit that it never executes code and has no runtime state, and that it audits workflow and action definitions only, not the scripts or programs those definitions call. Values produced at runtime, such as a matrix generated by an earlier job, cannot be resolved, and in those cases it errs on the side of reporting. The same constraint applies to any static checker of YAML, including actionlint.
That leaves several controls that must be enforced elsewhere:
- Organisation and repository defaults for
GITHUB_TOKENpermissions, set to read-only. - Policies restricting which actions may be used and requiring SHA pinning at organisation level.
- Environment protection rules and required reviewers for jobs that reach production secrets.
- OIDC trust policies that bind cloud roles to specific repositories, branches and environments; see our GitHub Actions OIDC Federation Hardening Guide.
- Ephemeral, isolated self-hosted runners, and monitoring of audit logs for unexpected workflow changes.
- A response plan for a compromised third-party action; see our Third-Party GitHub Action Compromise Response Playbook.
Common failure patterns
- Running the scan but not requiring it. The job runs and fails, but it is not a required status check, so merges proceed.
- SARIF upload without a gate. zizmor does not use finding exit codes in SARIF mode, so a job that only uploads SARIF never blocks.
- Broad suppressions. A regular expression that hides every "potentially untrusted" message, or a whole-file zizmor ignore added to unblock one pull request.
- Scanning with a powerful token. Reusing a release or admin token for zizmor's online mode, when read-only scope is enough.
- Unpinned scanners. Installing the analyser by piping a script from a main branch or pulling a
latestimage on every run. - Scanning only changed files. Reusable workflows and composite actions called by a changed workflow carry the real risk but are not scanned.
- Applying unsafe fixes unreviewed. Committing
--fix=alloutput without checking that workflow behaviour is unchanged. - Treating a clean scan as proof of safety. Runtime state, runner configuration and organisation settings are outside what either tool can see.
Practitioner checklist
- actionlint and zizmor run on every pull request that changes
.github/, and the job is a required status check. - Both tools are installed at pinned, verified versions; any wrapping action is pinned to a full SHA.
- The scanning workflow uses
pull_request,permissions: {}at workflow level andpersist-credentials: false. .github/actionlint.yamllists self-hosted runner labels and configuration variables, and path-scoped ignores carry reasons.zizmor.ymland inline ignores are narrow, explained and owned by the security team through code owners.- zizmor's online token is read-only and dedicated to scanning.
- Gates account for SARIF mode exit code behaviour.
- A scheduled organisation-wide scan runs with the auditor persona and
--no-ignoresat least quarterly. - Findings for
dangerous-triggers,template-injection,excessive-permissionsandimpostor-commitare treated as release blockers.
Standards and references
- actionlint: repository and README
- actionlint: configuration documentation
- actionlint: usage documentation
- zizmor: repository and README
- zizmor: audit rules
- zizmor: usage documentation
- OWASP: Top 10 CI/CD Security Risks
- MITRE ATT&CK: T1677 Poisoned Pipeline Execution
Related NHI Mgmt Group resources: GitHub and GitHub Actions Security Guide · GitHub Actions Script Injection Guide · How to Pin GitHub Actions to Commit SHAs · GitHub Actions OIDC Federation Hardening Guide