Checks the workflows, the workflow templates, the shell and Python code and snapshot-targets.txt of this repository,
and audits the workflows and actions with zizmor, on every push and pull request that changes one of them.
It runs in this repository and is not meant to be called by projects.
It can also be started by hand: Actions, "Lint", "Run workflow". That is needed after a force push, for example of a squashed commit, as the path filters then find no changed files and the workflow does not start by itself.
| Step | Checks |
|---|---|
| Run actionlint | All workflows in .github/workflows: syntax, expressions, references like inputs.* and steps.*, and the run blocks with shellcheck |
| Run actionlint on the workflow templates | The callers in workflow-templates, with the placeholder $default-branch replaced by main |
| Run shellcheck | The scripts .github/actions/*/*.sh and the run blocks of all composite actions, with ${{ … }} expressions replaced by a placeholder |
| Check the Python scripts | The scripts .github/actions/*/*.py parse as Python, without running them |
| Run zizmor | Security of the workflows and actions, e.g. injection, permissions, pinning and caches. Accepted findings are ignored with a # zizmor: ignore[…] comment where they occur, giving the reason |
| Check snapshot-targets.txt | Every line has the form <owner/repository> <workflow> [<branch or pattern>] and none uses * alone, errors point to the line |
All steps run even if another one fails, so one run shows all problems.
Findings in the run blocks of composite actions name the action and the step index, their line numbers count
from the start of that run block.
- Inputs passed to the actions of this repository. actionlint does not support the self-repository syntax
$/yet (rhysd/actionlint#711), its errors about$/references are ignored. Remove the-ignoreonce a release supports it. cache-modeof jobs. actionlint does not know the key yet (rhysd/actionlint#745), its error about it is ignored. Remove that-ignoreas well once a release supports it.- The structure of the
action.ymlfiles.
The steps "Install actionlint" and "Install zizmor" download fixed releases and verify their checksums.
Dependabot does not update them. To update, set VERSION and SHA256:
- actionlint:
SHA256is the line ofactionlint_<version>_linux_amd64.tar.gzinactionlint_<version>_checksums.txtof the release. - zizmor:
SHA256is the digest ofzizmor-x86_64-unknown-linux-gnu.tar.gzon the release page. A new version may bring new audits, whose findings need a fix or an ignore comment.
actionlint -ignore 'specifying action "\$/' -ignore 'reusable workflow call "\$/' \
-ignore 'unexpected key "cache-mode" for "job" section'
shellcheck .github/actions/*/*.sh
for script in .github/actions/*/*.py; do
python3 -I -c 'import ast, sys; ast.parse(open(sys.argv[1], encoding="utf-8").read(), sys.argv[1])' "$script"
done
zizmor --offline .The loop of the step "Run shellcheck" also runs locally, with yq 4 installed
and RUNNER_TEMP set to a temporary directory.