Skip to content

Commit b887ab5

Browse files
committed
ci(pre-commit-action): updated to simplified version provided by GitHub
1 parent 38b8d9c commit b887ab5

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
name: Pre-commit hooks CI
1+
name: Check pre-commit
2+
23
on:
34
pull_request:
4-
types: [opened, edited, reopened, synchronize]
5-
push:
6-
branches: [ master ]
75

86
jobs:
9-
pre-commit:
7+
check-pre-commit:
108
runs-on: ubuntu-latest
119
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v4
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: '3.9'
19-
20-
- name: Install pre-commit
21-
run: pip install pre-commit
22-
23-
- name: Run pre-commit on changed files
24-
if: github.event_name == 'pull_request'
25-
run: |
26-
git fetch origin ${{ github.base_ref }}
27-
git diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD ${{ github.base_ref }}) | xargs pre-commit run --files
28-
env:
29-
SKIP: "conventional-precommit-linter,eslint"
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-python@v5
14+
- uses: pre-commit/action@v3.0.1
15+
env:
16+
SKIP: "pip-compile,conventional-precommit-linter,eslint"

0 commit comments

Comments
 (0)