Manifest: run-pre-commit/action.yml
This action runs pre-commit by setting up Python and optionally installing the Rust toolchain, Hadolint, and Nix in the requested version. It requires a checkout with depth 0. It does the following work:
- Installs Python. The version can be configured via the
python-version
input. - Optionally sets up the Rust toolchain, Hadolint, and Nix.
- Runs pre-commit on changed files.
Example usage (workflow):
---
name: pre-commit
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
with:
fetch-depth: 0
submodules: recursive
- uses: stackabletech/actions/run-pre-commit
Tip
For descriptions of the inputs and outputs, see the complete run-pre-commit action.
python-version
(defaults to3.12
)rust
(eg:1.80.1
. Disabled if not specified)rust-components
(defaults torustfmt,clippy
)hadolint
(eg:v2.12.0
. Disabled if not specified)nix
(eg:2.25.2
. Disabled if not specified)nix-github-token
(eg:secrets.GITHUB_TOKEN
. Required whennix
is set)
None