Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.24 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.24 KB

run-pre-commit

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:

  1. Installs Python. The version can be configured via the python-version input.
  2. Optionally sets up the Rust toolchain, Hadolint, and Nix.
  3. 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

Inputs and Outputs

Tip

For descriptions of the inputs and outputs, see the complete run-pre-commit action.

Inputs

  • python-version (defaults to 3.12)
  • rust (eg: 1.80.1. Disabled if not specified)
  • rust-components (defaults to rustfmt,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 when nix is set)

Outputs

None