-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.08 KB
/
pre-commit.yml
File metadata and controls
40 lines (38 loc) · 1.08 KB
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
36
37
38
39
40
name: pre-commit
on:
workflow_dispatch:
push:
workflow_call:
inputs:
files:
type: string
description: "Files to run pre-commit on"
required: false
default: ""
exclude:
type: string
description: "Files to exclude from pre-commit"
required: false
default: "^$"
jobs:
pre-commit:
runs-on: ubuntu-latest
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
timeout-minutes: 5
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.12
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1
with:
files: ${{ inputs.files }}
exclude: ${{ inputs.exclude }}