Package: actionlint-py
Note: forpre-commithooks I recommend officially supported hooks:
See docs:https://github.com/rhysd/actionlint/blob/main/docs/usage.md#pre-commitactionlint-pyA python wrapper to provide a pip-installableactionlintbinary.Internally this package provides a convenient way to download the pre-built
actionlint binary for your particular platform.Installationpipinstallactionlint-pyUsageAfter installation, theactionlintbinary should be available in your
environment (oractionlint.exeon windows). Remember to add youScriptsfolder toPATH.As a pre-commit hookSeepre-commitfor introduction.I recommend using officially supported pre-commit hooks from actionlint itselfSee docs:https://github.com/rhysd/actionlint/blob/main/docs/usage.md#pre-commitUse this repo if you can not use officially supported hooks (docker, golang, system) and you are fine with pythonpipwrapper.Sample.pre-commit-config.yamlusingpipas package manager:-repo:https://github.com/Mateusz-Grzelinski/actionlint-pyrev:v1.6.26.11hooks:-id:actionlintadditional_dependencies:[pyflakes>=3.0.1,shellcheck-py>=0.9.0.5]# actionlint has built in support for pyflakes and shellcheck, sadly they will not be auto updated. Check https://pypi.org/project/actionlint-py/ for latest version. Alternatively:# args: [-shellcheck=/path/shellcheck -pyflakes=/path/pyflakes]# note - invalid path in arguments will fail silentlyBecauseactionlint-pyis available as source distribution, pip build system will fetch binary from (public)
github. It might cause problems with corporate proxy. In case of problems try this semi-manual setup that respects
yourpip.ini:-repo:localhooks:-id:actionlintname:actionlintdescription:Lint GitHub workflows with actionlintadditional_dependencies:[actionlint-py]#additional_dependencies: [actionlint-py==1.6.26.11]# safer, but pre-commit autoupdate will not work# note: the pip versioning scheme is different from actionlint binary: not "v1.6.26" but "1.6.26.11" (last number is build system version)entry:actionlint#args: [-ignore "*.set-output. was depracated.*"]language:pythontypes:["yaml"]files:"^.github/workflows/"Alternative methods of running actionlintAs pre-commit hooksSeeofficial docs for pre-commit integration-repo:https://github.com/rhysd/actionlintrev:v1.6.26hooks:-id:actionlint# - id: actionlint-docker# - id: actionlint-systemUse as github action stepUse directly in github action, seeofficial docs for github action integration:name:Lint GitHub Actions workflowson:[push,pull_request]jobs:actionlint:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v3-name:Download actionlintid:get_actionlintrun:bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)shell:bash-name:Check workflow filesrun:${{ steps.get_actionlint.outputs.executable }} -colorshell:bashOr using docker:name:Lint GitHub Actions workflowson:[push,pull_request]jobs:actionlint:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v3-name:Check workflow filesuses:docker://rhysd/actionlint:latestwith:args:-colorDevelopmentDevelopment of wrapper and releasing new version:
seeREADME-DEV.mdRoadmapAdd actionlint hook as dockersupportshellcheck-pyin docker imageauto update docker version in.pre-commit-hooks.yamlwhen using_custom_build/auto_update_main.pyaddshellcheck-pyas dependency (or at least document)Update tag in readme in github action when releasing new versionUpload also binary distribution, not only source distributionAdd unit tests to build systemSeeREADME-DEV.mdfor more TODOs.Won't do unless asked:support all platforms that actionlint supports (like freebsd)