-
Notifications
You must be signed in to change notification settings - Fork 34
35 lines (30 loc) · 822 Bytes
/
pre-commit.yml
File metadata and controls
35 lines (30 loc) · 822 Bytes
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
31
32
33
34
35
# .github/workflows/pre-commit.yml
name: pre-commit
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
# (Optional) speeds up subsequent runs
- name: Cache pre-commit envs
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit detect-secrets
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure