Correctness
Mistakes that make a run fail or misbehave: unknown keys and events, type errors in ${{ }} expressions, wrong inputs of actions and reusable workflows, broken needs: and cron, and scripts that shellcheck or pyflakes reject.
Static checker for GitHub Actions
jactionlint checks your workflows, composite actions and dependabot.yml. It type-checks expressions, validates the inputs of actions and runs shellcheck on your scripts. It finds script injection, risky triggers and tokens with more permissions than they need, and fixes what it can.
mise use -g jactionlintInstall with mise, or with Homebrew, PyPI, Docker or Go. All methods →
on:
push:
branch: main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "${{ github.event.head_commit.message }}"
- run: echo "${{ matrix.os }}"jactionlint test.yaml
test.yaml:1:1: workflow has no "concurrency:", so every run of it executes at the same time even when a newer run supersedes the older ones. add a top-level "concurrency:" with a "group:" and "cancel-in-progress: true" [concurrency-limits]
|
1 | on:
| ^~~
test.yaml:3:5: unexpected key "branch" for "push" section. expected one of "branches", "branches-ignore", "paths", "paths-ignore", "tags", "tags-ignore", "types", "workflows" [workflow-syntax]
|
3 | branch: main
| ^~~~~~~
test.yaml:5:3: "timeout-minutes" is not set at this job. Set it to avoid wasting runner minutes when the job hangs. Set "default-minutes" in the "missing-timeout" rule options of the configuration to turn on the --fix fix [missing-timeout]
|
5 | test:
| ^~~~~
test.yaml:5:3: neither the workflow nor this job sets "permissions:" so the GITHUB_TOKEN gets the default permissions of the repository. set "permissions:" at workflow-level or job-level (use "permissions: {}" for no permissions) because the "missing-permissions" rule is enabled [missing-permissions]
|
5 | test:
| ^~~~~
test.yaml:8:15: action "actions/checkout@v4" must be pinned to a full-length commit SHA like "{owner}/{repo}@{sha}" because the "unpinned-uses" rule is enabled [unpinned-uses]
|
8 | - uses: actions/checkout@v4
| ^~~~~~~~~~~~~~~~~~~
test.yaml:8:15: actions/checkout leaves the GITHUB_TOKEN in the git config of the workspace, where a later step such as an artifact upload can publish it. set "persist-credentials: false" under "with:" unless a later step needs to push [artipacked]
|
8 | - uses: actions/checkout@v4
| ^~~~~~~~~~~~~~~~~~~
test.yaml:9:24: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [template-injection]
|
9 | - run: echo "${{ github.event.head_commit.message }}"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.yaml:10:24: property "os" is not defined in object type {} [undefined-property]
|
10 | - run: echo "${{ matrix.os }}"
| ^~~~~~~~~What it checks
jactionlint started as a fork of actionlint and covers its checks, and its security rules follow the audits of zizmor. Every finding names its rule, and jactionlint --explain <rule> tells you why it matters and how to fix it.
Mistakes that make a run fail or misbehave: unknown keys and events, type errors in ${{ }} expressions, wrong inputs of actions and reusable workflows, broken needs: and cron, and scripts that shellcheck or pyflakes reject.
Patterns that let an outsider run code or steal a token: script injection, excessive permissions, dangerous triggers, cache poisoning, credentials left in the checkout and AI agents that anyone can steer.
Compare with zizmor →Conventions worth enforcing: actions pinned to a commit, explicit permissions, a timeout on every job and a concurrency group that cancels superseded runs. Turn each rule up, down or off in the config file.
See every rule →Automatic fixes
jactionlint --fix repairs the findings that have a mechanical fix, and --diff shows the change without writing it. On test.yaml above, it passes the untrusted message through an environment variable, gives the token read-only permissions and stops actions/checkout from keeping the token.
--fix=unsafe also applies the ones that may change it.--fix pins each action to the commit of its tag.jactionlint --diff test.yaml
--- a/test.yaml
+++ b/test.yaml
@@ -1,10 +1,17 @@
on:
push:
branch: main
+
+permissions:
+ contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - run: echo "${{ github.event.head_commit.message }}"
+ with:
+ persist-credentials: false
+ - run: echo "${HEAD_COMMIT_MESSAGE}"
+ env:
+ HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
- run: echo "${{ matrix.os }}"Adoption
The default profile can fail the first run on a repository that never followed it. Start with the bugs, record the rest and let the build fail only on what is new.
jactionlint --profile correctness The correctness profile has the checks of actionlint and the bug detectors of jactionlint. Its findings are mistakes, not debt.
jactionlint --baseline-writeThe default profile adds the security and policy rules. Write the findings that are left to a baseline.
jactionlint --baselinePay the baseline down at your own pace. An ignore comment silences a finding that you accept for good.
Integrations
The jactionlint action checks every push and pull request. Add this workflow to a repository, and pin the action to the commit of a release the way the default profile asks of every action.
name: jactionlint
on:
push:
branches: [main]
pull_request:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
jactionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: jdx/jactionlint@72c00452809bcca05b8bc12acdcf15dd7a9c1c5e # v2.6.0This workflow passes the default profile itself.
hk fix.Switching
jactionlint is a fork of rhysd/actionlint and reads its config file. --profile correctness keeps the checks that you have, and the default profile adds the security and policy rules when you are ready for them.
Each audit of zizmor 1.30.1 has a rule, under the same ID in every case but one. # zizmor: ignore[...] comments keep working, and --migrate-ignores rewrites them.
One command installs it. Run jactionlint at the root of a repository, with no configuration.
mise use -g jactionlintInstall with mise, or with Homebrew, PyPI, Docker or Go. All methods →