-
Notifications
You must be signed in to change notification settings - Fork 89
45 lines (43 loc) · 1.28 KB
/
lint.yaml
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
41
42
43
44
45
name: Lint
on:
pull_request_target:
branches:
- master
- externalAPI
jobs:
matrix:
runs-on: ubuntu-latest
name: Run ${{ matrix.checks }}
strategy:
matrix:
checks:
- pyupgrade
- black
- check-executables-have-shebangs
- check-json
- requirements-txt-fixer
- check-ast
- mixed-line-ending
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
token: ${{ secrets.PAT }}
- name: Set up Python
uses: actions/setup-python@v5
id: python
with:
python-version: "3.x"
- name: Install pre-commit
run: |
python3 -m pip install pre-commit
pre-commit install-hooks --config .github/pre-commit-config.yaml
- name: Run the check (${{ matrix.checks }})
run: pre-commit run --hook-stage manual ${{ matrix.checks }} --all-files --config .github/pre-commit-config.yaml
- name: Commit Changes
if: failure()
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "fix: ${{ matrix.checks }} action"