-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.82 KB
/
check_pull_request_title.yml
File metadata and controls
47 lines (42 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: "Check PR title"
on:
pull_request:
types: [edited, opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
statuses: write
jobs:
pr-title-check:
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.event.pull_request.user.login != 'allcontributors[bot]' }}
steps:
- uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Require imperative mood (e.g. "Add feature" not "Adds feature")
# ^ Start of string
# [A-Z] First character must be an uppercase ASCII letter
# [a-z]* Followed by zero or more lowercase letters
# (?<![^s]s) Negative lookbehind: disallow single 's' at end of first word
# ( .+)+ At least one space and one or more characters
# [^.] Final character must not be a period
# $ End of string
subjectPattern: '^[A-Z][a-z]*(?<![^s]s)( .+)+[^.]$'
subjectPatternError: |
The PR title must use imperative mood and proper formatting:
- Start with uppercase letter (e.g., "Add" not "add")
- Use base form of verb (e.g., "Add" not "Adds" or "Adding")
- Have multiple words (minimum 10 characters)
- Not end with a period
Valid: "Add new feature", "Fix bug in parser"
Invalid: "add feature", "Adds feature", "Add.", "Fix"
# Disable type prefixes (we don't use conventional commits format)
requireScope: false
ignoreLabels: |
ignore-title-check