Catalog PyPI
PACKAGE EXPLORERView in registry

actionlint-pants-plugin

PyPI

A Pantsbuild plugin for linting GitHub Actions workflow files with actionlint.

actionlintactionsgithublintlinterpantspantsbuildpluginworkflow
Versions collected1
Direct dependencies1From release 0.1.3
Last observed20 Oct, 18:32 UTC

README

Version 0.1.3 documentation

actionlint-pants-plugin

PyPI Version

A Pantsbuild plugin that lints GitHub Actions workflow files with actionlint: workflow syntax, ${{ }} expressions, action inputs, runner labels, and the shell scripts in run: steps.

Installation

Add the plugin to pants.toml. Pants ignores dot-directories by default, so .github/ MUST be made visible too:

[GLOBAL]
plugins = ["actionlint-pants-plugin==<version>"]
pants_ignore.add = ["!.github/"]

Declare the workflow targets next to the workflow files:

# .github/workflows/BUILD
github_workflow_sources()

Then run actionlint through the lint goal:

pants lint .github/workflows::   # or `pants lint ::`

How it works

actionlint is downloaded as a static binary; nothing is installed into a Pants resolve. The plugin registers a github_workflow_sources target generator, which yields one github_workflow_source target per *.yml or *.yaml file next to the BUILD file, and a pants lint integration over those targets. For each run Pants:

  1. Puts the workflow files, their dependencies and the config file (see below) into a sandbox, together with an empty .git directory: actionlint only reads its config and validates local uses: ./... references inside a git repository, and a sandbox is not one.
  2. Downloads shellcheck through Pants' [shellcheck] subsystem and passes it as -shellcheck, so run: steps are checked as they would be with shellcheck on the PATH. Set [actionlint].shellcheck = false to opt out. The pyflakes integration is always disabled, as Pants ships no pyflakes tool.
  3. Runs actionlint -color once per batch on the workflow files. The linter fails when actionlint does.

Target fields

FieldTargetPurpose
sourcesgithub_workflow_sourcesGlobs of workflow files, relative to the BUILD file. Default: ["*.yaml", "*.yml"].
sourcegithub_workflow_sourceOne workflow file.
dependenciesbothTargets the workflow uses: the files target holding a local action's action.yml, a reusable workflow, a script a step runs. actionlint validates the inputs of a local action whose action.yml is present, and pants --changed-since re-lints the workflow when a dependency changes.
skip_actionlintbothIf true, the file is excluded from pants lint.
overridesgithub_workflow_sourcesPer-file values for the fields above, e.g. overrides={"release.yml": {"skip_actionlint": True}}.

Configuration

actionlint reads .github/actionlint.yaml or .github/actionlint.yml from the repository root (reference). Pants includes that file automatically. Point [actionlint].config at a config file elsewhere to pass it as -config-file, which takes precedence over the repository config.

OptionDefaultPurpose
[actionlint].skipfalseSkip actionlint during pants lint.
[actionlint].args[]Extra arguments for actionlint, e.g. -ignore 'SC2086:.+' or -oneline. They follow the plugin's own flags, so a repeated flag overrides it.
[actionlint].configunsetPath to an actionlint config file, passed as -config-file. Disables discovery.
[actionlint].config_discoverytrueInclude .github/actionlint.yaml or .github/actionlint.yml from the build root.
[actionlint].shellchecktrueRun shellcheck on run: steps. The binary is the [shellcheck].version release; the other [shellcheck] options do not apply.
[actionlint].versionbundled defaultactionlint release to download.
[actionlint].known_versionsbundled defaultChecksums of downloadable releases; extend to use another version.

Using a different actionlint version

Add the release's checksums and sizes to known_versions and set version:

[actionlint]
version = "1.7.13"
known_versions.add = [
  "1.7.13|linux_arm64 |<sha256>|<size>",
  "1.7.13|linux_x86_64|<sha256>|<size>",
  "1.7.13|macos_arm64 |<sha256>|<size>",
  "1.7.13|macos_x86_64|<sha256>|<size>",
]

Compute each line with curl -L $URL | tee >(wc -c) >(shasum -a 256) >/dev/null, where $URL is the actionlint_<version>_<os>_<arch>.tar.gz asset of the GitHub release (linux/darwin, amd64/arm64).

Supported versions

PluginPantsPythonactionlint
0.x2.333.14>=1.7,<2

Pants loads plugins into its own interpreter, so the plugin requires the Python version Pants runs on.

Releases

Wheels are published to PyPI. Release notes live in the changelog and on the GitHub releases page.

Contributing, Bug Reports and Feature Requests

This plugin lives in the pants-plugin-depot repo. See its CONTRIBUTING.md, or open an issue.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.317 Oct 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
zach-overflow/pants-plugin-depot

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:32 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:f53e0b22eab7f65e59a74e64ead2eccf7cb1cc835b57fed09f2d57d6170b97f3