22name : Linters
33
44on :
5- pull_request :
65 workflow_dispatch :
6+ pull_request :
7+ paths-ignore :
8+ - ' **.md'
9+ - ' **.html'
10+ - ' **.csv'
11+ - ' **.po'
12+ - ' **.pot'
13+ - ' .editorconfig'
14+ - ' .gitattributes'
15+ - ' .gitignore'
16+ - ' license.txt'
17+ - ' README.md'
18+ - ' .github/workflows/copilot-setup-steps.yml'
719
820permissions :
921 contents : read
@@ -13,18 +25,36 @@ concurrency:
1325 cancel-in-progress : true
1426
1527jobs :
28+ commit-lint :
29+ name : ' Semantic Commits'
30+ runs-on : ubuntu-latest
31+ if : github.event_name == 'pull_request'
32+
33+ steps :
34+ - uses : actions/checkout@v5
35+ with :
36+ fetch-depth : 200
37+ - uses : actions/setup-node@v5
38+ with :
39+ node-version : 22
40+ check-latest : true
41+
42+ - name : Check commit titles
43+ run : |
44+ npm install @commitlint/cli @commitlint/config-conventional
45+ npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
46+
1647 linter :
17- name : ' Frappe Linter '
48+ name : ' Semgrep Rules '
1849 runs-on : ubuntu-latest
1950 if : github.event_name == 'pull_request'
2051
2152 steps :
22- - uses : actions/checkout@v4
23- - uses : actions/setup-python@v5
53+ - uses : actions/checkout@v5
54+ - uses : actions/setup-python@v6
2455 with :
2556 python-version : ' 3.10'
2657 cache : pip
27- - uses : pre-commit/action@v3.0.0
2858
2959 - name : Download Semgrep rules
3060 run : git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
@@ -39,14 +69,14 @@ jobs:
3969 runs-on : ubuntu-latest
4070
4171 steps :
42- - uses : actions/setup-python@v5
72+ - uses : actions/setup-python@v6
4373 with :
4474 python-version : ' 3.10'
4575
46- - uses : actions/checkout@v4
76+ - uses : actions/checkout@v5
4777
4878 - name : Cache pip
49- uses : actions/cache@v3
79+ uses : actions/cache@v4
5080 with :
5181 path : ~/.cache/pip
5282 key : ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
5989 pip install pip-audit
6090 cd ${GITHUB_WORKSPACE}
6191 pip-audit --desc on .
92+
93+ precommit :
94+ name : ' Pre-Commit'
95+ runs-on : ubuntu-latest
96+ if : github.event_name == 'pull_request'
97+
98+ steps :
99+ - uses : actions/checkout@v5
100+ - uses : actions/setup-python@v6
101+ with :
102+ python-version : ' 3.10'
103+ cache : pip
104+ - uses : pre-commit/action@v3.0.1
0 commit comments