Skip to content

Commit 0c47b20

Browse files
committed
ci: enforce Conventional Commits in PR titles
The squash-merge commit message defaults to the PR title, so gating titles on Conventional Commits gives release-plz clean input for changelog generation.
1 parent 0142b2b commit 0c47b20

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/pr-title.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
# Enforce Conventional Commits in the PR title so the squash-merge commit
16+
# message produces clean changelog entries for release-plz.
17+
conventional-commits:
18+
name: Conventional Commits
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: amannn/action-semantic-pull-request@v6
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
with:
25+
types: |
26+
feat
27+
fix
28+
chore
29+
docs
30+
refactor
31+
perf
32+
test
33+
build
34+
ci
35+
revert
36+
requireScope: false
37+
subjectPattern: ^[A-Za-z].+[^.]$
38+
subjectPatternError: |
39+
The subject "{subject}" must start with a letter and not end with a period.

0 commit comments

Comments
 (0)