Merge pull request #22 from Hasnep/update-flake-inputs #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Pre-commit | |
on: | |
# Run on all PRs | |
pull_request: | |
# Run when a PR is merged into main | |
push: | |
branches: | |
- main | |
jobs: | |
run-pre-commit: | |
name: Run pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # ratchet:DeterminateSystems/nix-installer-action@v16 | |
- name: Cache Nix environment | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # ratchet:DeterminateSystems/magic-nix-cache-action@v8 | |
- name: Use Nix dev shell for subsequent steps | |
uses: rrbutani/use-nix-shell-action@59a52b2b9bbfe3cc0e7deb8f9059abe37a439edf # ratchet:rrbutani/use-nix-shell-action@v1 | |
with: | |
extraNixOptions: --accept-flake-config | |
- name: Run Pre-commit | |
run: pre-commit run --all-files | |
env: | |
# Prevent this action failing when running on the main branch | |
SKIP: no-commit-to-branch |