-
Notifications
You must be signed in to change notification settings - Fork 11
37 lines (30 loc) · 993 Bytes
/
pre_commit_run.yml
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
# Copyright (c) 2022 Sebastian Pipping <[email protected]>
# Licensed under GPL v2 or later
name: Run pre-commit on all files
on:
- pull_request
- push
jobs:
run_pre_commit:
name: Run pre-commit on all files
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python 3.12
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.12
- name: Install pre-commit
run: |-
pip install \
--disable-pip-version-check \
--user \
--no-warn-script-location \
pre-commit
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Install pre-commit hooks
run: |-
pre-commit install --install-hooks
- name: Run pre-commit on all files
run: |-
pre-commit run --all-files --show-diff-on-failure