Actionlint validates GitHub Actions workflow files.
It detects syntax errors, invalid expressions, incorrect event configurations, unsupported keys, and several common workflow mistakes before they reach GitHub.
Actionlint is installed through Homebrew:
brew install actionlintIt is part of the curated Homebrew environment; see Homebrew setup to install everything at once.
Check that Actionlint is available:
actionlint --versionFrom the root of a repository, run:
actionlintBy default, Actionlint searches for workflow files in:
.github/workflows/
A specific workflow can also be analyzed directly:
actionlint .github/workflows/ci.ymlActionlint reports:
- the affected file;
- the line and column;
- a description of the problem;
- the relevant workflow expression or YAML fragment.
A successful validation produces no output and returns a zero exit status.
When ShellCheck is installed, Actionlint can use it to analyze shell commands embedded in GitHub Actions steps.
Both tools are included in this setup through Homebrew.
This provides additional validation for steps such as:
- name: Run checks
run: |
echo "$VALUE"
./scripts/check.shThe repository contains a GitHub Actions workflow under:
.github/workflows/ci.yml
Validate all workflows manually from the repository root:
actionlintA successful validation produces no output and returns a zero exit status.
Actionlint is integrated into the local pre-commit configuration.
The hook targets workflow files under:
.github/workflows/
Run the hook directly with:
pre-commit run actionlint --all-filesHomebrew manages the Actionlint executable, while pre-commit controls when validation is executed.
Because ShellCheck is also installed, Actionlint can analyze shell commands embedded in workflow steps.
Remove Actionlint with:
brew uninstall actionlintThen remove its entry from profiles/full/Brewfile.
Any related pre-commit hook must also be removed separately.
