Skip to content

Commit e3b8f0d

Browse files
authored
Merge pull request #69 from LeakIX/dw/pr-hygiene-checks
CI: add PR size and commit message quality checks
2 parents 37f496c + b61d01a commit e3b8f0d

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/pr-hygiene.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR hygiene checks
2+
on:
3+
pull_request:
4+
types: [assigned, opened, synchronize, reopened]
5+
branches:
6+
- main
7+
merge_group:
8+
types: [checks_requested]
9+
10+
jobs:
11+
check-pr-size:
12+
name: Check PR size
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
- name: Download script
19+
run: |
20+
curl -sSLO \
21+
"https://raw.githubusercontent.com/dannywillems/toolbox/main/pr-hygiene/check-pr-size.sh"
22+
chmod +x check-pr-size.sh
23+
- name: Check PR size
24+
run: >
25+
./check-pr-size.sh
26+
"${{ github.event.pull_request.base.sha }}"
27+
28+
check-commit-messages:
29+
name: Check commit messages
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
fetch-depth: 0
35+
- name: Download scripts
36+
run: |
37+
for script in check-title-length.sh \
38+
check-no-fixup.sh check-commit-body.sh; do
39+
curl -sSLO \
40+
"https://raw.githubusercontent.com/dannywillems/toolbox/main/pr-hygiene/${script}"
41+
chmod +x "${script}"
42+
done
43+
- name: Check title length
44+
run: >
45+
./check-title-length.sh
46+
"${{ github.event.pull_request.base.sha }}"
47+
- name: Check no fixup/WIP commits
48+
run: >
49+
./check-no-fixup.sh
50+
"${{ github.event.pull_request.base.sha }}"
51+
- name: Check commit body on large changes
52+
run: >
53+
./check-commit-body.sh
54+
"${{ github.event.pull_request.base.sha }}"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
### Infrastructure
12+
13+
- CI: add PR hygiene checks using dannywillems/toolbox ([a4c3b19], [#69])
14+
1115
## [2.0.1] - 2026-03-17
1216

1317
### Changed
@@ -204,6 +208,7 @@ and this project adheres to
204208

205209
<!-- Commit links -->
206210

211+
[a4c3b19]: https://github.com/LeakIX/l9format-python/commit/a4c3b19
207212
[953d604]: https://github.com/LeakIX/l9format-python/commit/953d604
208213
[72bf877]: https://github.com/LeakIX/l9format-python/commit/72bf877
209214
[c9216ba]: https://github.com/LeakIX/l9format-python/commit/c9216ba
@@ -307,4 +312,5 @@ and this project adheres to
307312
[#64]: https://github.com/LeakIX/l9format-python/pull/64
308313
[#65]: https://github.com/LeakIX/l9format-python/pull/65
309314
[#67]: https://github.com/LeakIX/l9format-python/pull/67
315+
[#69]: https://github.com/LeakIX/l9format-python/pull/69
310316
[#43]: https://github.com/LeakIX/l9format-python/issues/43

0 commit comments

Comments
 (0)