Skip to content

Configuration ​

Choose a profile, set rule levels and options, describe your runners and accept findings in .github/jactionlint.yaml. This page shows where jactionlint reads the config file and what every key does. jactionlint works without one.

Configuration file ​

A config file is a YAML file at .github/jactionlint.yaml. Every key is optional, an empty file is valid and an unknown key is rejected. This example chooses a profile, changes the level and an option of some rules, declares runner labels and variables, silences a rule in some files and accepts one finding:

yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/jdx/jactionlint/main/schema/jactionlint-config.json
profile: default

rules:
  missing-timeout: warn       # lower the level of a rule the profile enables
  require-shell: error        # turn on a rule the profile does not enable
  max-run-lines:              # a rule with options takes a mapping
    level: warn
    max: 40

self-hosted-runner:
  labels: [linux.2xlarge, linux-multi-gpu]

config-variables: [DEFAULT_RUNNER, ENVIRONMENT_STAGE]

paths:
  .github/workflows/legacy-*.yaml:
    ignore:
      - missing-permissions

ignores:
  - rule: unpinned-uses
    uses: actions/checkout
    file: .github/workflows/release.yaml
    reason: pinned by an organization ruleset

The first line is a comment that gives editors the JSON Schema of the file, so they complete keys, rule IDs and rule options. Find what you want to do in this table:

You want toSetDetails
Choose which rules runprofileProfiles
Change the level of a rule, turn it off or set its optionsrulesRule levels and options
Silence rules in some filespathsIgnore findings in some files
Accept a finding with a reason and an expiry date, in a way that survives edits of the workflowignoresDurable ignores
Describe your runners, variables and secrets, or a Forgejo or Gitea platformself-hosted-runner, config-variables, config-secrets, platformKey reference
Turn on the checks that query the GitHub APIonline, online-optionsOnline options
Accept the current findings and fix them step by stepbaselineBaseline and fixes
Share settings between repositoriesextends, or a user-global fileExtending config files, Where jactionlint reads the config file
Replace old keys--migrate-configDeprecated keys

Generate the initial configuration ​

jactionlint --init-config writes .github/jactionlint.yaml in the repository that holds the current directory and prints the path of the new file:

sh
jactionlint --init-config

The file starts with the schema comment, explains the main keys in comments and sets nothing except empty self-hosted-runner.labels, config-variables: null, config-secrets: null and empty paths and rules. The command does not overwrite a file: when a config file under any name of the repository config file exists in .github, it prints config file already exists at "<path>" and exits with status 3.

The command needs a project: a repository that has .github/workflows, .github/actions or an action.yml at its root. It also needs a .github directory and does not create one, so a project whose only marker is a root action.yml needs .github first. Without a project or without .github, the command exits with status 3.

To rewrite a file that uses deprecated keys, run jactionlint --migrate-config.

Where jactionlint reads the config file ​

jactionlint uses one config file per project and never merges these files. It uses the first of these that exists, even when that file is broken: a parse error, or a missing file in its extends, stops the run with exit status 3 and jactionlint does not try the next one:

  1. The file of --config-file (-c). It replaces both files below, and its extends entries still apply.
  2. The repository config file: the first that exists of .github/jactionlint.yaml, .github/jactionlint.yml, .github/actionlint.yaml and .github/actionlint.yml.
  3. The user-global config file: the first that exists of jactionlint/jactionlint.yaml, jactionlint/jactionlint.yml, actionlint/actionlint.yaml and actionlint/actionlint.yml in your user config directory.

The user config directory is $XDG_CONFIG_HOME when that variable holds an absolute path. Otherwise it is $HOME/.config, on every platform (%USERPROFILE%\.config on Windows), so the usual user-global config file is $HOME/.config/jactionlint/jactionlint.yaml. A relative $XDG_CONFIG_HOME is ignored, as the XDG Base Directory specification requires.

The project of a linted file is the nearest parent directory that is a repository (it has .git or .jj) and has .github/workflows, .github/actions or an action.yml or action.yaml at its root. A monorepo has one config file at its root. A nested repository or submodule with its own workflows uses its own config file.

The user-global file applies to a project that has no repository config file, and to input that jactionlint reads from stdin, which belongs to a project only when --stdin-filename names an existing file in it. Use the user-global file for personal or organization defaults that many repositories share, or for a CI base image that needs a config without a file in every checkout. A repository config file always wins over the user-global file. To build on a shared file instead of replacing it, list it in extends.

--profile applies on top of whichever file is used.

The names actionlint.yaml and actionlint.yml are the ones that actionlint reads, so an existing actionlint config keeps working. A file with such a name that sets no profile runs under the default profile, which has more rules than actionlint, and jactionlint prints a note: line that says so. A config file written for actionlint explains the differences.

Profiles ​

A profile is a named set of rules that run together. profile selects one, and each profile includes the rules of the one before it. When profile is omitted, the default profile runs. --profile NAME on the command line overrides the key for one run.

ProfileEnables
correctnessWhat actionlint checks (syntax, expressions, actions, workflow_call, permissions, credentials, events, globs, runner labels, shell names, IDs, needs, matrix, if:, shellcheck, pyflakes) and the bug detectors of jactionlint, such as unsound-ternary, workflow-run-names, local-action-checkout, action-syntax and dependabot-syntax.
defaultcorrectness plus the security and policy rules that are worth failing a build on, for example for pinned actions and images, permissions, timeouts, concurrency, dangerous triggers, artifact and cache poisoning, unverified downloads and trusted publishing.
pedanticdefault plus the noisy and opinionated rules, such as require-shell, max-run-lines, anonymous-definition, self-hosted-runner and unused-needs, and the noisier findings of the rules that have the option pedantic.

The correctness profile has almost no security or policy rules. These are the exceptions:

  • template-injection (untrusted input in scripts, in container: options and in the prompts of AI agent actions) and hardcoded-container-credentials, which actionlint checks too.
  • expired-ignore and unused-baseline-entry, which check your ignores and your baseline.

The profile of each rule is in the Profile column of the rules page, in jactionlint --list-rules and in jactionlint --explain RULE. Choose a profile covers the first run on a repository, and the policy for jactionlint's features says how a rule gets into a profile.

These cases sit outside the plain rule sets of the profiles:

  • The opt-in rules belong to no profile and run only when the config file turns them on. They report nothing until you give them their setting: forbidden-uses needs allow, deny, images-allow or images-deny, required-actions needs the required-actions list, unreachable-required-check needs the required-checks list, and timeout-too-long needs its option max. Writing the setting turns the rule on at its default level, in every profile: the option in the rules entry of the rule, or, for required-actions and unreachable-required-check, the top-level list.
  • The online rules do not follow a profile either. They run at their own level when the online checks are on.
  • The option pedantic turns the noisier findings of a rule on or off. Unset, it is true under the pedantic profile and false otherwise, so rules: {template-injection: {pedantic: true}} reports the noisier findings of that rule under the default profile, and pedantic: false turns them off under the pedantic profile. The rules page shows the option in the rules that have it.

profile: strict and profile: all in a config file are read as pedantic with a deprecation warning, and --migrate-config rewrites them (see Deprecated keys). The command-line option does not accept them: jactionlint --profile strict exits with status 2.

Rule levels and options ​

rules sets the level and the options of each rule by its rule ID. A level is one of these values:

ValueEffect
errorjactionlint prints the finding and exits with status 1.
warnjactionlint prints the finding with a warning: prefix. The exit status does not change unless you pass --strict-exit. warning is accepted as a spelling of warn.
infoThe same as warn, with an info: prefix.
off or falseThe rule does not run.
trueThe rule runs at its default level.

A rule that you do not list follows the profile: it runs at its default level when the profile includes it, and it is off otherwise. The default level belongs to the rule and is error, warn or info: see the Default level column of the rules page. To run one rule once, whatever the profile says, use --select RULE (Run one rule).

A rule with options takes a mapping with the optional key level and the options. A mapping without level turns the rule on at its default level, also when the profile does not include the rule:

yaml
rules:
  missing-timeout: warn        # a level
  require-shell: off           # off, although the pedantic profile enables it
  max-run-lines:               # a level and an option
    level: warn
    max: 80
  timeout-too-long:            # options only: the rule runs at its default level
    max: 60
  unpinned-uses:               # an option that maps patterns to policies
    policies:
      actions/*: ref-pin
      my-org/*: any

The rules page lists the options of each rule with their types and defaults, and jactionlint --explain RULE prints them under Options (in "rules"). An option has one of these types:

  • int: a non-negative integer.
  • number: a non-negative number. Decimals are accepted.
  • bool: true or false.
  • strings: a list of strings.
  • string-map: a mapping from strings to strings.

jactionlint rejects an option that a rule does not have, and an unknown rule ID. The message suggests the closest valid name when there is one (see When the config file is rejected).

Ignore findings in some files ​

paths maps a glob to the findings that jactionlint ignores in the files the glob matches. The glob is matched to the path relative to the repository root, with / as the separator, and it supports ** and braces such as *.{yml,yaml} (doublestar syntax). The only key of an entry is ignore, a list of patterns:

yaml
paths:
  .github/workflows/**/*.{yml,yaml}:
    ignore:
      - unpinned-uses
      - 'shellcheck reported issue in this script: SC2086:.+'

A pattern is a rule ID or a regular expression on the message of the finding: Write a pattern describes the syntax, and Ignore findings helps you choose between paths, ignore comments and the other ways to ignore a finding. --ignore takes the same patterns for every file of one run. jactionlint rejects an invalid glob or regular expression, and paths cannot change the level of a rule for some files.

Durable ignores ​

An ignore comment sits next to the line it covers, so a tool that rewrites the line can overwrite the comment. When Renovate or Dependabot bumps uses: actions/checkout@<sha> # v4.1.0, it replaces the trailing comment with the new version, and the ignore is gone. An entry of ignores does not have this problem: it names the rule and describes the place by what the workflow says, not by its position.

yaml
ignores:
  - rule: unpinned-uses            # a rule ID, or a list of IDs: [unpinned-uses, artipacked]
    uses: actions/checkout         # the action, whatever its ref is
    file: .github/workflows/*.yaml # optional glob
    job: release                   # optional job ID
    step: checkout                 # optional step id or name
    reason: pinned by an organization ruleset
    expires: "2030-12-31"
KeyTypeMeaning
rulestring or list of stringsRequired. A rule ID or a list of them. jactionlint rejects an unknown ID.
fileglobMatches the path relative to the project root, and the path as printed. ** crosses directories, and the separator is always /.
jobstringThe ID of the job (its key under jobs), without regard to case. Matches findings anywhere in the job, including its steps.
stepstringThe id or the name of the step, compared as written. Matches findings anywhere in the step.
usesstringThe uses: value of the step, or of the job when it calls a reusable workflow. See Forms of uses.
reasonstringWhy the finding is accepted. It is free text for the readers of the file, and it appears in the messages about the entry.
expiresstring YYYY-MM-DDThe entry suppresses through the end of that day (UTC) and stops after it. Write the date in quotes.
allow-unusedbooleantrue keeps the entry from being reported as unused-ignore when it suppresses nothing, for a finding that comes and goes, such as a moving tag. Expiry is still checked. Default false.

An entry needs at least one of file, uses, job and step. To turn a rule off everywhere, use rules. Every key that an entry sets must match, and entries are not combined: two entries are two independent reasons to ignore.

Forms of uses ​

uses takes one of three forms:

  • A name pattern like the patterns of forbidden-uses: actions/checkout (the root action of the repository), actions/* (every action of the owner, including the ones in directories), owner/repo/* and owner/repo/sub. Names are case-insensitive. Without @ref, any ref matches, so the entry keeps working when a tool changes the tag or the SHA. A @ref must match the ref of the step, and it accepts * wildcards: actions/checkout@v4 matches only that ref, and actions/checkout@v* matches every tag that starts with v. Refs are case-sensitive.
  • A glob with * for values that are not repository references: docker://alpine* and ./.github/actions/*. A local path can be written ./path or $/path, and the entry matches both spellings.
  • A regular expression between slashes, matched to the whole uses: value and not anchored unless you write ^ or $: /^actions\/(checkout|cache)@/. The syntax is RE2.

Which job and step a finding belongs to ​

jactionlint finds the job and the step whose YAML block contains the line of the finding, the same blocks that an ignore comment covers:

  • A finding on the uses: line of a step belongs to that step and its job.
  • A finding on the jobs.<id> line or on the runs-on of a job belongs to the job and to no step.
  • A finding about the workflow as a whole (permissions, on) belongs to neither, so only rule and file can match it.
  • When the structure is ambiguous, for example two steps in one flow-style line (steps: [{uses: a}, {uses: b}]), the step is unknown, and an entry that asks for step or uses does not match. An ignore never suppresses on a guess.
  • The steps of a parallel: group are steps like the others. An entry finds them by their uses and by their id or name.

Expiry and unused entries ​

  • On the day after expires, the entry stops suppressing: the findings it hid come back. The entry itself is reported as expired-ignore (level error, in the correctness profile) at its position in the config file, with its reason. Fix the findings or renew the date.
  • During the last 14 days, the entry still works and is reported as expired-ignore with level info, so you are warned before the findings come back. An entry that is about to expire and suppresses nothing is also reported as unused-ignore, unless it sets allow-unused: true.
  • An entry that suppressed nothing is reported as unused-ignore at its position in the config file. This is the rule that also reports unused ignore comments, so it is in the pedantic profile.
  • A pre-commit hook lints only the changed files, so an entry is called unused only when every file it could apply to was linted in the run. A run that lints a single file never reports an entry that also applies to others.
  • An entry for a rule that did not run is not unused: the rule is off, it is an online rule and the online checks are off, or it is shellcheck or pyflakes without its command.
  • --ignore expired-ignore hides the findings about entries like any other finding, and --no-ignores applies no entry, so it reports none.

Entries of the files listed in extends are added to the entries of the file that extends them, extended files first. A finding about an entry is reported in the file that contains it.

Key reference ​

Every top-level key of the config file is in this table with its type, its default, the command-line option that does the same and its effect. A key with sub-keys has a table of its own in the group after this table. The old keys that rules replaced are in Deprecated keys.

KeyTypeDefaultCommand-line equivalentEffect
profilecorrectness, default or pedanticdefault--profileChooses which rules run. See Profiles.
extendslist of pathsnonenoneConfig files to inherit from. See Extending config files.
rulesmapping from rule ID to a level or a mappingthe profile decidesnoneSets the level and the options of each rule. See Rule levels and options.
pathsmapping from a glob to {ignore: [...]}none--ignore, for every fileIgnores rule IDs or messages in the files that match a glob. See Ignore findings in some files.
ignoreslist of mappingsnonenoneAccepts findings by rule and place, with a reason and an expiry date. See Durable ignores.
self-hosted-runnermappingnonenoneDescribes your runner labels. See Runners.
config-variableslist of strings, or nullnull (no check)noneThe names that the vars context may use. See Variables and secrets.
config-secretslist of strings, or nullnull (no check)noneThe names that the secrets context may use. See Variables and secrets.
required-actionslist of mappingsempty (no check)noneActions that every workflow must use. See Required actions.
required-checkslist of mappingsempty (no check)noneThe checks that branch protection or a ruleset requires. See Required checks.
assume-default-permissionsrestricted or permissiveunsetnoneThe token permissions to assume for a caller that sets none. See Permissions.
platformgithub, forgejo or giteagithubnoneThe system that runs the workflows. See Platform.
generated-filesreport, skip-policy or skipskip-policynoneWhat to do with files that a tool wrote. See Generated files.
shellcheckmappingnone--shellcheck-rcfile, for rcfileHow shellcheck runs. See Options for shellcheck.
onlinebooleanfalse--online, --no-online, JACTIONLINT_ONLINETurns on the online checks. See Online options.
online-optionsmappingsee the table--online=MODE and the --online-* optionsTunes the online checks. See Online options.
baselineauto, a boolean or a pathnone--baseline, --no-baselineHides the findings recorded in a baseline file. See Baseline and fixes.
fixmappingnone--fix-rules, for rulesLimits the fixes. See Baseline and fixes.
updatemappingnone--min-age, --freeze, --include-tag, --exclude-tagSets the defaults of jactionlint update. See Update.

Command line describes each option. When a setting has a command-line option, the option wins over the config file.

Runners ​

self-hosted-runner tells jactionlint which labels your runners have, so that runs-on does not report them as unknown.

KeyTypeDefaultEffect
self-hosted-runner.labelslist of glob patternsemptyThe labels of your self-hosted runners. The syntax is the one of path.Match. The runner label check accepts them, and the self-hosted-runner rule treats a job that uses one as running on a self-hosted runner.
self-hosted-runner.strict-labelsbooleanfalseWhen true, runs-on accepts only the labels listed in labels.
self-hosted-runner.providerslist of provider namesall providersThe hosted-runner providers whose labels runs-on accepts without a listing in labels.

With strict-labels: true, the built-in labels are reported unless you list them too. These are the GitHub-hosted runner labels such as ubuntu-latest and the preset self-hosted labels such as self-hosted, linux and x64. Use it when every job must run on your own runners, or when your runners (for example the runner sets of Actions Runner Controller) do not carry the self-hosted label. The checks for conflicting labels still apply to listed built-in labels.

The labels of a hosted-runner service are not GitHub labels, so without providers each of them would be an unknown label. When the key is unset, jactionlint accepts the labels of all providers in the table. A list accepts only the providers in it, and an empty list accepts none. Names are case-insensitive.

A service that is not in the table goes in labels. providers has no effect when strict-labels is true.

ProviderLabels it accepts
blacksmithblacksmith-*
depotdepot-ubuntu-*, depot-windows-*, depot-macos-*
namespacenamespace-profile-*, nscloud-*, namespace-features:*
runsonruns-on=..., runs-on/..., runner=..., family=..., image=... and the other label keys of RunsOn
ubicloudubicloud, ubicloud-arm, ubicloud-standard-*, ubicloud-premium-*
warpbuildwarp-*

Variables and secrets ​

config-variables and config-secrets list the names that exist in your repository or organization, so that jactionlint can report a name that does not.

KeyTypeDefaultEffect
config-variableslist of strings, or nullnullWith a list, jactionlint checks the vars context against it and reports a name that is not listed. An empty list allows no variable. null, or no key, turns the check off. See GitHub's documentation of variables.
config-secretslist of strings, or nullnullThe same for the secrets context. GITHUB_TOKEN is always allowed. The check applies only when the workflow does not declare its secrets itself (for example secrets: under on.workflow_call), because declared secrets are checked against their declaration. See GitHub's documentation of secrets.

Both checks report the rule undefined-property, which also reports other undefined properties of contexts. To switch the two checks off, remove the keys or set them to null.

Required actions ​

required-actions lists the actions or reusable workflows that every workflow must use. The required-actions rule is opt-in: it runs when the list is not empty. A missing action is reported once per workflow, at the position of its first job.

yaml
required-actions:
  - action: actions/checkout
  - action: github/codeql-action/init
    version: v3
KeyTypeDefaultEffect
required-actions[].actionstringrequiredThe name of the action, such as actions/checkout, without @version. A sub-path is part of the name (github/codeql-action/init). The name is case-insensitive, and reusable workflow calls (jobs.<id>.uses) are matched too. A value with @, a local path (./... or $/...), a Docker image (docker://...) or a name without / is rejected.
required-actions[].versionstringany versionThe ref (tag, branch or commit SHA), compared exactly. The requirement is satisfied when at least one use of the action has this ref.

Local actions and Docker images never match. Only workflow files are checked. The steps of composite action files (action.yml) are not (composite actions).

Required checks ​

required-checks lists the checks that branch protection or a ruleset of the repository requires, and the changes they are required for. GitHub waits forever for a required check that no job reports, for example when a paths filter keeps the workflow from starting. The rule unreachable-required-check reports such a check. It runs, in every profile, when the list is not empty. The list is local: jactionlint does not read the settings of the repository from GitHub, so keep it in step with them.

yaml
required-checks:
  - name: CI gate
    events: [pull_request, merge_group]
    branches: [main]
  - name: test (ubuntu-24.04, 22)
KeyTypeDefaultEffect
required-checks[].namestringrequiredThe name of the check as GitHub shows it in the settings: the name: of the job or its ID, with the values of a matrix job in parentheses, or caller / callee for a job of a reusable workflow. The comparison is exact.
required-checks[].eventslist of pull_request, pull_request_target, merge_group and push[pull_request]The events that must report the check. Add merge_group when the branch uses a merge queue.
required-checks[].brancheslist of stringsnoneThe literal names of the base branches that the requirement protects. With them, the branches and branches-ignore filters of the workflows are judged. Without them, a branch filter is reported as something the rule cannot decide. Patterns such as release/* are rejected.

A name that no job reports is reported at its line in the config file. A filter that keeps the check from reporting is reported in the workflow. When the rule cannot decide, it reports at level info and says why. Required checks that never report has the details and the limits.

Permissions ​

assume-default-permissions tells the check for reusable workflow calls which token permissions to assume for a caller that has no permissions: block at the workflow level and none on the calling job. The permissions of such a caller come from the repository setting (Settings, Actions, General, Workflow permissions), which jactionlint cannot read from a workflow file.

ValueEffect
unsetjactionlint gives the caller the benefit of the doubt and assumes the permissive default, like permissive.
restrictedAssumes GitHub's restricted default token (contents: read and packages: read, every other scope none). jactionlint reports every other scope that the called workflow needs.
permissiveAssumes the permissive default (write on every scope, id-token included, which GitHub grants to a called job when the repository default is permissive).

The key affects only callers that have no permissions: block anywhere. When a caller declares any block, even permissions: {}, the check runs against that block, because GitHub treats a scope that an explicit block omits as none. The rule is workflow-call-permissions; see Reusable workflows.

Platform ​

platform names the system that runs the workflows: github (the default), forgejo or gitea. jactionlint treats forgejo and gitea alike. On both, a step can run an action from any host by the URL of its repository, as in uses: https://code.forgejo.org/actions/checkout@v4 (actionlint#698). On GitHub that is a malformed uses: and stays a finding, so the switch is off unless you set it. With forgejo or gitea, jactionlint treats such a value like this:

  • It checks the form https://{host}/{owner}/{repo}[/{path}]@{ref}. A value without a host, an owner, a repository or a ref is reported as invalid-uses.
  • It applies the pinning policy of unpinned-uses to {owner}/{repo}, whatever the host is.
  • forbidden-uses and required-actions read it as {owner}/{repo}[/{path}]@{ref}, too. These rules look at the repository, as unpinned-uses does, and not at the host. So allow: ['actions/*'] allows https://code.forgejo.org/actions/checkout@v4, and that value satisfies required-actions: [{action: actions/checkout}].
  • It does not look the action up in the data about GitHub actions (inputs, outdated runtimes), and the online checks do not apply to it: an action at another host is another action. The other rules that read a uses: value (typosquats, popular actions, cache and artifact checks) do not know the value.

A reusable workflow call (jobs.<id>.uses) is not covered.

Generated files ​

generated-files tells jactionlint what to do with a workflow file whose first comment says that a tool wrote it, such as # This file was automatically generated by gh-aw. DO NOT EDIT., # generated by praktika or # Generated by projen. The author of such a file fixes the generator, not the file.

ValueEffect
skip-policy (default)The rules of the policy and style groups (missing-timeout, unused-job-output, anonymous-definition, unpinned-uses and so on) do not report in the file. The correctness and security rules still do.
reportThe file is treated like any other file.
skipNothing is reported in the file.

Only the comment block at the top of the file counts, within its first 40 lines. The comment must be a generator marker: it starts with a wording such as automatically generated, generated by or managed by modulesync, or it is only DO NOT EDIT. A sentence such as # do not edit the matrix by hand or # generated by hand is not a marker. unused-ignore does not flag an ignore comment or an ignores entry for a rule that is not reported in such a file.

Options for shellcheck ​

shellcheck tunes how jactionlint runs shellcheck for the scripts of run: steps (shellcheck integration). By default jactionlint passes --norc, so a .shellcheckrc in the working directory cannot change the results. Use the keys when you want an rc file or more arguments in every run, for example where you cannot set SHELLCHECK_OPTS, which shellcheck still reads (pre-commit.ci is one such place). The option --shellcheck-rcfile overrides rcfile.

KeyTypeDefaultEffect
shellcheck.rcfilepathnoneA shellcheckrc file to read instead of --norc. A relative path is resolved from the repository root, and the file must exist, or the run exits with status 3. A repository config file can name only a file inside the repository. The user-global file and --config-file can name any file. The settings of the rc file (disable=SC2086, enable=..., source-path=...) apply.
shellcheck.argslist of stringsemptyMore arguments for shellcheck, such as --exclude=SC2129, --severity=warning or -eSC2129. Write one option per item and attach its value with =: an item is never a file name.
shellcheck.enablelist of stringsemptyOptional checks of shellcheck to turn on, like --enable=NAME,NAME. all turns on every optional check. A name is lowercase letters, digits and dashes.

jactionlint sets the output format, the shell of each script, -x and the script itself. So args rejects --format, --color, --shell, --norc, --rcfile, --version and --wiki-link-count, and the short forms -f, -C, -s, -V and -W.

jactionlint always passes -e SC1091,SC2194,SC2050,SC2153,SC2154,SC2157,SC2043, the codes that give false findings in workflow scripts: a file that exists only in CI, a variable that env: defines, and the placeholder that replaces ${{ }}. An --exclude in args adds to them. An --include in args makes shellcheck report only the codes it names, and that includes a code from the built-in list, which it brings back.

yaml
shellcheck:
  rcfile: .github/shellcheckrc
  enable: [avoid-nullary-conditions, require-variable-braces]

Online options ​

online turns on the online checks, which query the GitHub API, for the files that the config file applies to. The default is false: nothing uses the network. online-options tunes them, and every sub-key is optional. The keys apply to the whole run and come from the configuration of the first file for which the online checks run.

A setting has this priority: a command-line option, then the environment variable JACTIONLINT_ONLINE (1, a mode or 0: see the accepted values), then the config file. --no-online and JACTIONLINT_ONLINE=0 turn the checks off whatever the file says. A mode of cache, strict or cache,strict also turns the online checks on, unless the file says online: false explicitly: an explicit false wins over the mode.

KeyTypeDefaultCommand-line equivalentEffect
online-options.modecache, strict or cache,strictnone (plain online mode)--online=MODEcache never uses the network and answers from the cache. strict makes a skipped lookup exit with status 3. A config file accepts exactly these three spellings, while --online also accepts other orders.
online-options.api-urlURL$GITHUB_API_URL, else derived from $GITHUB_SERVER_URL or $GH_HOST, else https://api.github.com--online-api-urlThe REST API of a GitHub Enterprise Server, such as https://ghe.example.com/api/v3. The URL must not contain credentials. jactionlint sends no token to a host that the config file of a repository names here. It sends one to a host that the environment, --online-api-url, the user-global file or --config-file names.
online-options.token-envnamenone--online-token-envThe environment variable that holds the token. It is read before GITHUB_TOKEN and GH_TOKEN.
online-options.token-filepathnone--online-token-fileThe file that holds the token. It is read after token-env.
online-options.github-com-fallbackbooleanfalse--online-github-com-fallbackOn a GitHub Enterprise Server, also asks api.github.com about the repositories that the Server does not have. The names of those repositories are sent to github.com: list internal ones in deny.
online-options.github-com-token-envnameGITHUB_COM_TOKEN--online-github-com-token-envThe environment variable that holds the token for api.github.com in the fallback. jactionlint reads the variable that you name first, then github-com-token-file, then GITHUB_COM_TOKEN.
online-options.github-com-token-filepathnone--online-github-com-token-fileThe file that holds the token for api.github.com in the fallback. It is read after github-com-token-env.
online-options.allowlist of owner/repo patternsempty (all repositories)--online-allowThe repositories that may be looked up. * is a wildcard within a part (mycorp/*, */setup-*), and case does not matter.
online-options.denylist of owner/repo patternsempty--online-denyThe repositories that may not be looked up, such as internal actions that GitHub cannot answer for. deny wins over allow.
online-options.cache-ttlduration1h--online-cache-ttlHow long a cached answer is used without asking GitHub again. 0s revalidates every answer.
online-options.max-rate-limit-waitduration30s--online-max-waitThe longest jactionlint waits for a rate limit to reset. 0s never waits.
online-options.retriesinteger from 0 to 102noneHow often a request is repeated after a server error or a secondary rate limit.
online-options.concurrencyinteger from 0 to 326noneHow many requests are in flight at most. 0 selects the default.
online-options.gh-clibooleantruenoneAsks gh auth token for a token when no variable or file has one.

A duration is written in Go syntax, such as 90s, 15m or 1h. Online checks covers the token order, the cache and the behavior with a GitHub Enterprise Server.

yaml
online: true
online-options:
  deny: ["mycorp/*"]   # internal actions GitHub cannot answer for
  max-rate-limit-wait: 10s

Baseline and fixes ​

KeyTypeDefaultCommand-line equivalentEffect
baselineauto, a boolean or a pathnone (no baseline)--baseline[=FILE], --no-baselineHides the findings recorded in a baseline file, so that a repository adopts the checks step by step. auto or true applies .github/jactionlint-baseline.json when that file exists. false, or no key, applies no baseline. Any other value is the path of the baseline file relative to the repository root, and the file must exist, or the run exits with status 3. jactionlint --baseline-write writes the file.
fix.ruleslist of rule IDsempty (every fix)--fix-rules--fix and --diff apply only the fixes of these rules. jactionlint rejects an unknown ID. See Fix findings automatically.

Update ​

The update mapping sets the defaults of jactionlint update. The command-line options win over it.

KeyTypeDefaultCommand-line equivalentEffect
update.cooldown-daysinteger0--min-ageUse only releases at least this many days old. 0 turns the cooldown off. A negative number is an error.
update.freezebooleanfalse--freezePin references to the commit SHA of the chosen release, with the version in a comment.
update.include-tagsglob or list of globsevery tag--include-tagOnly tags that match one of the patterns are eligible. Braces expand.
update.exclude-tagsglob or list of globsnone--exclude-tagTags that match are never eligible, and this wins over include-tags.
update.exclude-prereleasesbooleanfalsenoneLeave out releases that GitHub marks as prereleases.
update.require-immutable-releasesbooleanfalsenoneAccept only published, immutable releases; there is no fallback to tags.

Extending config files ​

extends lists config files to inherit from. It makes an organization-wide configuration possible: keep a shared file in a repository or a submodule, and extend it from every project.

yaml
extends:
  - ../shared/jactionlint.yaml
  - /etc/jactionlint/org.yaml
profile: pedantic
rules:
  require-shell: off
  • A relative path is resolved from the directory of the file that lists it, not from the working directory. An absolute path is accepted.
  • Later files win over earlier ones, and the file itself wins over all of them. A key that a later file does not write keeps the value of the earlier files.
  • A listed file can extend other files, up to ten levels deep. jactionlint rejects a cycle and a deeper chain.
  • A listed file that does not exist stops the run with exit status 3, whichever config file lists it: the file of --config-file, the repository config file or the user-global file. The message names the config file and the listed file. jactionlint does not skip the config file that lists it, and it does not fall back to the next file of the lookup order or to the defaults. Only a config file that does not exist itself counts as "no config file here".

The keys merge as follows when more than one file writes them:

KeyMerge
profile, online, baseline, platform, generated-files, assume-default-permissions, config-variables, config-secrets, required-actions, required-checksThe later value replaces the earlier one, an empty list included.
rulesMerged by rule ID. The entry of the later file replaces the whole entry of the earlier file, so its level and its options replace the earlier ones.
pathsMerged by glob. The entry of the later file replaces the entry with the same glob.
self-hosted-runner, shellcheck, fix, update, online-optionsMerged by sub-key (labels, strict-labels and providers; rcfile, args and enable; rules; each key of update; each key of online-options). A sub-key that a later file writes replaces the earlier value, a list included.
ignoresConcatenated, the extended files first.
extendsNot inherited.

Deprecated keys ​

The keys in the table below, which the first config files used, and the profile names strict and all are replaced by profile and rules. They still work: jactionlint translates them and prints one deprecation warning on stderr for each deprecated key. With --format sarif, the warnings are in toolConfigurationNotifications of the log, and stderr stays empty. The messages show the path of the config file as you gave it to --config-file, and the absolute path of a file that jactionlint finds on its own. For example, jactionlint --config-file .github/jactionlint.yaml prints this warning for require-commit-hash:

warning: config file ".github/jactionlint.yaml": "require-commit-hash" is deprecated and will be removed in a future version. use "rules: {unpinned-uses: error}" instead. run "jactionlint --migrate-config" to rewrite the file
Deprecated keyReplacement
profile: strict, profile: allprofile: pedantic
require-commit-hash: truerules: {unpinned-uses: error}
require-permissions: truerules: {missing-permissions: error}
require-checkout-before-local-action: truerules: {local-action-checkout: error} (the correctness profile enables it)
require-expression-wrapping: truerules: {require-expression-wrapping: error}
check-falsy-ternary: truerules: {unsound-ternary: error} (the correctness profile enables it)
check-workflow-run-names: truerules: {workflow-run-names: error} (the correctness profile enables it)
require-shell: truerules: {require-shell: error}
max-run-lines: Nrules: {max-run-lines: {level: error, max: N}}
timeout-minutes: {required: true}rules: {missing-timeout: error}
timeout-minutes: {required: false}rules: {missing-timeout: off}
timeout-minutes: {max: N}rules: {timeout-too-long: {level: error, max: N}} (missing-timeout is left to the profile)

Setting a boolean key to false, or max-run-lines: 0, turns the rule off. That is how an old file disables local-action-checkout, unsound-ternary and workflow-run-names, which the correctness profile enables. A rule that you write in rules wins over the deprecated key.

jactionlint --migrate-config rewrites the deprecated keys of the repository config file, or of the file of --config-file, in place. It keeps the comments and the other keys, removes blank lines and adds the new rules to rules, which it creates at the position of the first deprecated key when the file has none. A rule with options is written as a one-line mapping, and a rule that is already in rules keeps its entry.

The command prints what it did and exits with status 0. It does not rewrite the files that extends lists: run it with --config-file on each of them. Without a config file it exits with status 3. The example passes the file with --config-file, and a file that jactionlint finds on its own is shown with its absolute path in the message. Before:

yaml
profile: strict   # the old name of pedantic

# Pin every action.
require-commit-hash: true

max-run-lines: 40

timeout-minutes:
  required: true
  max: 30

Run the command:

sh
jactionlint --migrate-config --config-file .github/jactionlint.yaml

It prints:

Config file ".github/jactionlint.yaml" was migrated. Replaced the deprecated keys with "rules": require-commit-hash, max-run-lines, timeout-minutes, profile

After:

yaml
profile: pedantic # the old name of pedantic
# Pin every action.
rules:
  unpinned-uses: error
  max-run-lines: {level: error, max: 40}
  missing-timeout: error
  timeout-too-long: {level: error, max: 30}

A second run changes nothing and prints:

Config file ".github/jactionlint.yaml" has no deprecated key. Nothing was changed

Rule IDs that were merged into another rule are retired, and the rules page lists them. rules, ignores and fix.rules refuse a retired ID with a message that names the new place. --ignore, paths and ignore comments still accept it with a deprecation warning, and the ignore covers only the findings that the old rule reported.

JSON Schema ​

The config file has a JSON Schema (draft-07), generated from the rule registry. The rule IDs are the only keys allowed under rules and an enum in fix.rules and ignores, each rule lists its own options, and the other keys are described. Use it for completion and for checking the file in an editor or in CI:

  • In the file, add the comment that --init-config writes at the top. Editors that use yaml-language-server (VS Code with the YAML extension, Neovim, Helix and others) then complete and check the keys, the rule IDs and the options of each rule:

    yaml
    # yaml-language-server: $schema=https://raw.githubusercontent.com/jdx/jactionlint/main/schema/jactionlint-config.json
  • Print the schema of the installed version, which always matches the rules of that binary: jactionlint --print-config-schema > jactionlint-config.json.

  • In CI, validate the file with any JSON Schema validator, for example check-jsonschema --schemafile jactionlint-config.json .github/jactionlint.yaml.

The committed copy is schema/jactionlint-config.json. The parser of jactionlint is the authority: where the schema and the parser differ, the parser is right, and the difference is a bug of the schema. The findings of --format json have a schema too: see JSON schema of the output.

When the config file is rejected ​

jactionlint checks the whole config file before it lints anything. A file that cannot be read or parsed stops the run with exit status 3, and nothing is linted. Deprecation warnings do not stop the run. Parsing is strict at every level: an unknown key is rejected in the top-level mapping, in self-hosted-runner, online-options, shellcheck, fix, paths, ignores, required-actions, required-checks and in the options of a rule. A message about the content of the file starts with could not parse config file and the path of the file, and ends with the cause. The causes read like these:

CauseThe message ends with
A misspelled keyunknown key "self-hosted-runnr" in the configuration at line 1, column 1. did you mean "self-hosted-runner"?
An option that the rule does not haveunknown key "max" in the options of rule "unpinned-uses" at line 3, column 5. available keys are "actions-lock", "level", "policies", "short-pin-comment"
An unknown rule IDunknown rule ID "unpinned-use" in "rules" at line 2, column 3. did you mean "unpinned-uses"? see https://jactionlint.jdx.dev/rules for all rule IDs
A level that does not existyaml: construct errors: line 2: invalid severity "fatal". available values are "off", "info", "warn" and "error" at line 2, column 20
A value of the wrong typeinvalid value 1.5 for option "max" of rule "max-run-lines" in "rules": it must be a non-negative integer
A value outside the allowed setinvalid value "bitbucket" for "platform". available values are "github", "forgejo" and "gitea"

A file that the config names must exist too. The run exits with status 3 for a missing baseline file, a missing shellcheck.rcfile, and for a missing extends file, in any config file (see Extending config files). --init-config and --migrate-config exit with status 3 when they cannot do their work.

Next steps ​

MIT LicenseCopyright © 2026jdx.dev