-
Notifications
You must be signed in to change notification settings - Fork 3
30 lines (28 loc) · 1.13 KB
/
run-pre-commit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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