Skip to content

Commit d040710

Browse files
authored
feat: create a lint action
1 parent 9587aa3 commit d040710

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Python
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install nox
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install nox
30+
31+
- name: Prepare noxfile
32+
run: cp noxfile-template.py noxfile.py
33+
34+
- name: Make script executable
35+
run: chmod +x .github/scripts/lint-changed.sh
36+
37+
- name: Run lint script for changed files
38+
run: |
39+
.github/scripts/lint-changed.sh \
40+
"${{ github.event_name }}" \
41+
"${{ github.base_ref || github.ref_name }}" \
42+
"${{ github.event.before }}"

0 commit comments

Comments
 (0)