Coming from actionlint
Switch a repository from actionlint to jactionlint: keep the checks of actionlint with the correctness profile, rename the options and read the differences.
jactionlint is a fork of actionlint. It reads the same workflow files and the same configuration file. Its correctness profile covers the checks of actionlint and adds rules for more mistakes, and its default profile adds security and policy rules that you can adopt after the switch.
Switch in five steps
- Install jactionlint. A package named
actionlintinstalls the original project, so choose an installation method of this fork. - Select the
correctnessprofile in.github/jactionlint.yamlor with--profile correctness, as Get the behavior of actionlint shows. - Rename the options in your scripts, CI steps and hooks. actionlint accepts the two-dash spellings too, so you can rename before you replace the binary.
- Keep the config file written for actionlint or move it to
.github/jactionlint.yaml. - Check what depends on the output: the ignore patterns, the templates and the label at the end of a finding (the rule behind a finding).
When the switch works, read where jactionlint differs and adopt more checks.
Get the behavior of actionlint
Select the correctness profile to get the checks of actionlint without the security and policy rules that default adds. Write it in .github/jactionlint.yaml:
profile: correctnessOr pass it on the command line, which wins over the file:
jactionlint --profile correctnessWithout a profile jactionlint applies default, which also has rules such as unpinned-uses, missing-permissions, missing-timeout and concurrency-limits. A repository that never asked for them sees new findings until it selects a profile.
The correctness profile is not an exact copy of actionlint. It has rules for mistakes that actionlint does not check, and it accepts some constructs that actionlint rejects. Where jactionlint differs lists both.
Turn rules off on top of it
Turn a rule off, or lower its level, under rules with its rule ID:
profile: correctness
rules:
unsound-ternary: off
workflow-run-names: off
shellcheck: warn # lower the level: warnings do not fail the runEvery rule of the correctness profile that actionlint has reports at the level error, so the exit status is 1 when one of them finds something, as with actionlint. A rule that you set to warn or info does not fail the run unless you pass --strict-exit.
Ignore single findings in one of three ways:
--ignore PATTERN, andignoreunderpathsin the config file, take a regular expression that matches the message, as in actionlint, or a rule ID.- A
# jactionlint ignore=RULEcomment ignores the findings of one line or step. actionlint has no ignore comments. - An entry of
ignoresin the config file ignores findings by file, job, step oruses:, and it can expire. actionlint has no such entries.
Ignore findings has the syntax and the scopes.
jactionlint rewords some messages (what stays the same shows an example). A regular expression written for the old wording can stop matching, so run jactionlint once after the switch and replace the pattern of a finding that reappears by its rule ID.
Rename the options
Every option of actionlint has a two-dash spelling in jactionlint. The table names each option by what it does. The old single-dash spellings are in the migration table.
| What it does | Option | Notes |
|---|---|---|
| Print the help | --help (-h) | Prints to stdout. actionlint prints to stderr. |
| Print the version | --version (-V) | |
| Print verbose or debug logs | --verbose (-v), --debug | |
| Choose the output format | --format FORMAT (-f) | Also takes the names text, oneline, json, jsonl, sarif, gcc, github and summary. A value that contains {{ }} is a Go template. |
| Print one line per finding | --oneline | Same as --format oneline. |
| Force or disable color | --color, --no-color | --color takes a value only as --color=never, --color=always or --color=auto. A bare --color means always. |
| Ignore findings | --ignore PATTERN (-i) | A regular expression on the message, or a rule ID. Repeatable. |
| Use another config file | --config-file FILE (-c) | |
| Write a config file | --init-config | Writes .github/jactionlint.yaml, where actionlint writes .github/actionlint.yaml. Exits with status 3 when the repository has a config file already, also one named for actionlint. |
| Name the file read from stdin | --stdin-filename NAME | |
| Choose shellcheck | --shellcheck CMD | An empty value turns the integration off. A command that does not exist exits with status 3, where actionlint ignores it. |
| Choose pyflakes | --pyflakes CMD | Same as --shellcheck. |
The short options -V, -v, -c, -f, -p and -i exist in jactionlint only. A script that must run with both tools uses the long spellings. Command line lists every option of jactionlint, including those that actionlint does not have.
A config file written for actionlint
jactionlint reads the config file of actionlint. It looks for the name jactionlint.yaml first and for actionlint.yaml after it, in the repository and in your user config directory. Where jactionlint reads the config file lists the names and their order.
The keys self-hosted-runner, config-variables and paths carry over with the same meaning. config-secrets, profile, rules and the other keys of jactionlint do not exist in actionlint, which ignores keys that it does not know. A file that both tools read can therefore hold profile: correctness.
A file named for actionlint has no profile, so the default profile applies. jactionlint says so once per run, on stderr and as a notification in the SARIF log:
note: config file ".github/actionlint.yaml" was read as a jactionlint config. it sets no "profile", so the default profile applies, which has more rules than actionlint. add "profile: correctness" to the file or run with --profile correctness for the checks of actionlint. see https://jactionlint.jdx.dev/actionlintTo get the checks of actionlint, add profile: correctness to the file or pass --profile correctness, which also silences the note. To use the name of jactionlint, rename the file to .github/jactionlint.yaml. --migrate-config does not add a profile: it reports that the file has no deprecated key.
jactionlint parses the file strictly. A key that it does not know, such as the typo self-hosted-runnr, ends the run with exit status 3 and the suggestion did you mean "self-hosted-runner"?, where actionlint ignores the key.
Find the rule behind a finding
A finding of jactionlint ends with the ID of its rule, where actionlint prints its kind. The kind is still on every finding: it is the kind field of --format json and {{.Kind}} in a template. The table maps each kind of actionlint to the rules that report it, and Rules has the group, level and profile of each.
| Label in actionlint | What it covers | Rules of jactionlint |
|---|---|---|
syntax-check | Structure of the workflow file: unexpected, missing and duplicate keys, empty mappings, YAML anchors and merge keys | workflow-syntax, duplicate-key, yaml-syntax, merge-key, recursive-alias, unused-anchor |
expression | Syntax, types, contexts and functions of ${{ }}, script injection and the types of reusable workflow inputs | expression-syntax, expression-type, undefined-property, undefined-function, invalid-function-call, context-availability, template-injection, workflow-input-type |
if-cond | Constant conditions and if: that is always true | constant-condition, if-always-true |
action | The format of uses:, the inputs of actions, local actions and outdated runtimes | invalid-uses, missing-action-input, unknown-action-input, deprecated-action-input, outdated-action-runner, invalid-local-action |
events | Webhook events, activity types, filters, inputs of workflow_dispatch and workflow_call, cron and time zones | unknown-event, invalid-activity-type, invalid-event-filter, invalid-event-config, invalid-workflow-dispatch-input, invalid-workflow-call-input, invalid-cron, cron-too-frequent, invalid-timezone |
workflow-call | Calls of reusable workflows | invalid-workflow-call, missing-workflow-input, unknown-workflow-input, missing-workflow-secret, unknown-workflow-secret, invalid-local-workflow |
job-needs | Dependencies and IDs of jobs | undefined-job-needs, cyclic-job-needs, duplicate-job-needs, duplicate-job-id |
matrix | Values and exclude of a matrix | matrix-duplicate-value, matrix-invalid-exclude |
runner-label | Labels of runners | unknown-runner-label, conflicting-runner-labels, invalid-label-pattern |
id | Job and step IDs | invalid-id, duplicate-step-id |
permissions | Scopes and values of permissions: | invalid-permissions |
glob | Glob patterns of filters | invalid-glob |
credentials | Hardcoded credentials of containers | hardcoded-container-credentials |
env-var | Names of environment variables | invalid-env-var-name |
shell-name | Names of shells | invalid-shell-name |
deprecated-commands | Deprecated workflow commands | deprecated-commands |
shellcheck, pyflakes | shellcheck and pyflakes on run: scripts | shellcheck, pyflakes |
Rules that actionlint does not have carry a kind too, and a few share one of the kinds above: unsound-ternary has the kind expression, action-syntax has syntax-check and workflow-call-permissions has workflow-call. A script that filters on a kind can therefore see findings that actionlint never reported.
Two commands map a finding to its documentation. The first prints what a rule does, its options and its section of the checks page. The second lists every rule with its group, profile, level and summary.
jactionlint --explain duplicate-key
jactionlint --list-rulesWhat stays the same and what is tested
The table lists what you can rely on besides the findings, checked by running both tools.
| What | Same in jactionlint | Different |
|---|---|---|
| Text format | file:line:col: message [label], followed by an excerpt of the source | The label is the rule ID, where actionlint prints the kind. |
| Exit status | 0 for no findings, 1 for findings, 2 for an invalid option and 3 for a fatal error | A finding of level warn or info does not fail the run (exit status). |
| Templates | --format takes a Go template with the fields Message, Filepath, Line, Column and Kind, and {{json .}} keeps its keys | A finding has more fields, such as the rule ID, the severity and the documentation URL (output formats). |
| Ignore patterns | A regular expression on the message in --ignore and in paths | Some messages are reworded, and a pattern can be a rule ID. |
| Config keys | self-hosted-runner, config-variables and paths | jactionlint has more keys, and it rejects keys that it does not know (config file). |
A duplicate job ID shows the label and the wording. For this workflow file, saved as .github/workflows/x.yaml:
on: push
jobs:
a:
runs-on: ubuntu-latest
steps:
- run: echo a
A:
runs-on: ubuntu-latest
steps:
- run: echo ajactionlint prints this finding with the correctness profile:
jactionlint --profile correctness.github/workflows/x.yaml:7:3: key "A" is duplicated in "jobs" section. previously defined at line 3, column 3. note that this key is case insensitive [duplicate-key]
|
7 | A:
| ^~actionlint prints the same finding with another label and another wording:
.github/workflows/x.yaml:7:3: key "A" is duplicated in "jobs" section. previously defined at line:3,col:3. note that this key is case insensitive [syntax-check]
|
7 | A:
| ^~go test runs the correctness profile on the workflow files and expected outputs that come from the tests of actionlint, with the config file of a workflow file when it has one. For each line of an expected output, jactionlint must report a finding with the same message, line, column and kind, and findings that the output does not list are not checked, because the profile may report more. The test has two limits. Where jactionlint words a message differently or accepts a construct that actionlint rejects, the expected output of the file was edited, so the test shows that the profile covers the checks of actionlint, not that every message is identical. It calls the library only, so the command line, exit statuses, output formats, config discovery and the online checks are not part of it.
Where jactionlint differs
The tables compare the correctness profile with actionlint on the same workflow file. A later release of actionlint can close a gap. The cases of the second and third table were checked by running both tools.
Findings that only jactionlint reports
actionlint has no check for these rules of the correctness profile, so a repository that passed actionlint can have findings from them. Turn one off with rules: {RULE: off}. For the step keys that background-step-not-waited and invalid-parallel-step need, actionlint reports an unexpected key instead (constructs that only jactionlint accepts). A run without operands also checks composite actions and .github/dependabot.yml, which actionlint does not check (what a run checks). The Actions lock file is checked by a rule of the default profile.
| Rule | What it finds |
|---|---|
action-syntax | The metadata of an action does not follow the syntax of action.yml. |
dependabot-syntax | .github/dependabot.yml does not follow the syntax of the Dependabot configuration. |
background-step-not-waited | A step reads the outputs of a background step before a wait step covers it. |
invalid-parallel-step | A step inside a parallel group is not allowed there or refers to a wrong step. |
concurrency-deadlock | A workflow and the local reusable workflow that it calls use the same concurrency group, so GitHub cancels the run. |
conflicting-action-inputs | Two inputs of a well-known action exclude each other. |
environment-file-redirect | A script writes to GITHUB_OUTPUT or another environment file without the $, or empties the file with > after writing to it. |
gh-without-token | A script runs gh but neither GH_TOKEN nor GITHUB_TOKEN reaches the step. |
github-script-syntax | The script of actions/github-script has a JavaScript syntax error. |
local-action-checkout | A local action is used before a step checks out the repository. |
malformed-expression-delimiters | Text such as ${ github.ref } or $ {{ x }} is meant as an expression but is not one. |
multiline-plain-run | A run: is written over several lines without |, so YAML folds the lines into one command. |
unsound-ternary | a && b || c where b can be falsy, so the expression always evaluates to c. |
workflow-call-permissions | A caller job grants fewer permissions than the reusable workflow that it calls requires. |
workflow-run-names | A workflow_run trigger names a workflow that does not exist in the repository. |
invalid-ignore-comment, expired-ignore, unused-baseline-entry | A malformed ignore comment, an expired entry of ignores and a baseline entry that matches nothing. They report only when you use ignore comments, ignores or a baseline. |
Findings that differ
| Case | actionlint | jactionlint | Rule |
|---|---|---|---|
| Untrusted input in a place other than a script | Reports scripts only. | Also reports the options of a container, the prompt of an AI agent action and, in the default profile, free text from outside the workflow such as string inputs and ref_name (the check). | template-injection |
A property of github.event that no webhook event has, such as github.event.worflow_run | Reports nothing, because it does not type this object (actionlint#39). | Reports the property with a suggestion, except in a workflow with a trigger whose payload is not known (the check). | undefined-property |
| A quoted value passed to an input of a reusable workflow | Reports "true" for an input of type string and accepts '1' for an input of type number. | Treats a quoted value as a string: it accepts "true" for a string input and reports '1' for a number input. | workflow-input-type |
A call of an overloaded function such as contains that fits no signature | Reports one finding per signature. | Reports one finding about the signature that fits best. | invalid-function-call |
A context that is not available at a place, such as runner in the env of a job | Reports the context, and also a property that does not exist, such as runner.fooooooo. | Reports the context once. | context-availability |
| The wording of a message | previously defined at line:3,col:3 | previously defined at line 3, column 3 | duplicate-key |
| The position of a shellcheck finding | The run: key of the step. | The token of the script that has the problem (where shellcheck findings are reported). | shellcheck |
| shellcheck or pyflakes is not installed | Says nothing. | Prints a note: on stderr and does not change the exit status. An explicit --shellcheck=CMD or --pyflakes=CMD with a command that does not exist exits with 3. | shellcheck, pyflakes |
Workflow files in a subdirectory of .github/workflows | Checks every .yml and .yaml file below the directory. | Checks the files directly in the directory, because GitHub does not load the others. A file that you pass as an argument is always checked. | none |
Constructs that only jactionlint accepts
jactionlint follows the workflow schema of GitHub where it is newer than actionlint, and its built-in data, such as runner labels and the inputs of popular actions, is newer too. jactionlint accepts each construct below. actionlint reports it as the second column says:
| Construct | What actionlint reports | Rule |
|---|---|---|
needs: [] and a filter without a value such as tags: | The section or the string should not be empty. | workflow-syntax |
if: | followed by a line with ${{ }} alone | The condition is always true because of the newline at the end of the block scalar, which GitHub trims. | if-always-true |
A top-level description:, cancel-timeout-minutes on a job, types of the image_version event and an empty string in the options of a choice input | An unexpected key, or a string that should not be empty. | workflow-syntax |
The stacked type of pull_request and pull_request_target | An invalid activity type. | invalid-activity-type |
The drives permission | An unknown permission scope. | invalid-permissions |
github.artifacts and github.artifacts_list | A property that is not defined. | undefined-property |
The steps, job, runner and env contexts, the status functions and hashFiles in snapshot.if | A context or function that is not allowed there. | context-availability |
The step keys background, wait, wait-all, cancel and parallel, and the top-level key cache-mode | An unexpected key, or a step that has neither run nor uses. | workflow-syntax |
A runner label or an input of a popular action that is newer than the data of actionlint, such as ubuntu-26.04 or the input allow-unsafe-pr-checkout of actions/checkout | An unknown label or an input that is not defined. | unknown-runner-label, unknown-action-input |
Where shellcheck findings are reported
actionlint reports a shellcheck finding at the run: key of the step. jactionlint reports it at the token of the script that has the problem, the $FOO of echo $FOO, with a region that covers the token. A pull request annotation then sits on the right line and column.
This holds for every way to write the script: a literal block (|, |-, |+), a folded block (>), and a plain, single-quoted or double-quoted scalar, with escapes, folded lines and a ${{ }} that spans several lines. The position is the position in the workflow file. The line and column that shellcheck computed for the script stay in the message, as in SC2086:info:2:6: for the second line of a script. When jactionlint cannot map the position, for example for a finding at the end of the script, it reports the finding in the column of the run: key.
A tool that keys on the line of a finding sees the difference:
- An ignore comment keeps working. A
# jactionlint ignore=shellcheckcomment on the step still covers every line of the script. Ignore comments has the scopes, including a comment inside the script. - An
--ignorepattern or anignoreunderpathsis not tied to a line. It matches the message or the rule ID, so the difference does not affect it. - A tool that keeps
file:linepairs written for actionlint needs the new lines. Refresh the list once. A baseline written by jactionlint does not use line numbers.
Adopt more checks
After the switch you can raise the profile in steps. default adds the security and policy rules, such as unpinned-uses, missing-permissions, missing-timeout, excessive-permissions, concurrency-limits, artipacked, cache-poisoning, dangerous-triggers and use-trusted-publishing. pedantic adds the noisy and opinionated rules. Select default, then record today's findings in a baseline so that runs fail only on new findings.
A pin policy shrinks the first wave of unpinned-uses findings: it accepts tags for the owners that you trust and keeps the full commit SHA for the rest. The Actions lock file of the repository counts as a pin by default (the option actions-lock of unpinned-uses is true).
rules:
unpinned-uses:
policies:
"actions/*": ref-pinThe online checks, which ask GitHub about the actions that a workflow uses, are off until you turn them on. Turn on the online checks shows how, and Online checks describes them.
CI, hooks and editors
The names of the action, the image, the hook and the problem matcher differ from the ones of actionlint. Each task has a page that owns it:
- GitHub Actions: the action
jdx/jactionlint(the action), mise (mise), the Docker imageghcr.io/jdx/jactionlint(Docker) and the problem matcher file.github/jactionlint-matcher.json(problem matchers). - hk: add
--profile correctnessto thecheck,check_diffandfixcommands of the step to keep the findings of actionlint (hk). - pre-commit: the hook ID is
jactionlint(pre-commit). - Editors and other tools: editors and other tools. Tools written for actionlint do not run jactionlint, and some pass the single-dash options of actionlint, which jactionlint rejects (tools written for actionlint).
Go programs that import actionlint
A Go program that imports github.com/rhysd/actionlint imports github.com/jdx/jactionlint/v2 instead, and the package is named jactionlint. A program that sets no profile runs the default profile. Set Config.Profile or LinterOptions.Profile to ProfileCorrectness to keep the checks of actionlint. Go API describes the library.
Next steps
- Adopt more checks with a baseline without a wall of findings.
- Command line reference for every option of jactionlint.
- Configuration for profiles, rule levels, ignores and the online options.
- Checks for what each rule finds, with examples.
- jactionlint and zizmor for the security and policy rules compared with zizmor.