-
-
Notifications
You must be signed in to change notification settings - Fork 688
20 lines (18 loc) · 625 Bytes
/
pr.yml
File metadata and controls
20 lines (18 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name: PR
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title Prefix
id: title-check
uses: actions/github-script@v9
with:
script: |
const prefs = ["feat", "fix", "breaking", "chore"];
const title = context.payload.pull_request.title.toLowerCase();
const hasValidPrefix = prefs.some(prefix => title.startsWith(`${prefix}:`));
if (!hasValidPrefix)
core.setFailed("PR title must start with 'feat:', 'fix:', 'breaking:' or 'chore:'");