Skip to content

Commit 0faaa2a

Browse files
committed
Add workflow and config file to check PR titles
1 parent 121c6b8 commit 0faaa2a

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"LABEL": {
3+
"name": ""
4+
},
5+
"CHECKS": {
6+
"prefixes": ["fix: ", "feat: ", "security: ", "notice: ", "chore: ", "chore(deps): ", "chore(main): ", "ci: ", "docs: ", "test: "]
7+
},
8+
"MESSAGES": {
9+
"success": "Pull request title is properly formatted.",
10+
"failure": "Pull request title must begin with a valid prefix (e.g. 'feat: ')",
11+
"notice": ""
12+
}
13+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ensure PR title has a valid prefix
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
pull_request_target:
8+
types:
9+
- opened
10+
- edited
11+
- synchronize
12+
- labeled
13+
- unlabeled
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
21+
with:
22+
disable-sudo: true
23+
egress-policy: audit
24+
- name: Check PR title
25+
uses: thehanimo/pr-title-checker@v1.4.3
26+
with:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
pass_on_octokit_error: false
29+
configuration_path: .github/workflows/pr-title-checker-config.json #(optional. defaults to .github/pr-title-checker-config.json)

0 commit comments

Comments
 (0)