-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (33 loc) · 1 KB
/
pre-commit.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
38
39
40
# GitHub action to check if pre-commit has been run. Runs from .pre-commit-config.yaml, where the pre-commit actions are.
name: run-pre-commit
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
permissions:
pull-requests: write
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.PAT }}
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
id: pre_commit
continue-on-error: true
run: |
if pre-commit run --color always --all-files; then
echo "Succeeded check passed"
else
echo "Failed, exiting"
exit 1
fi