-
-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (63 loc) · 2.02 KB
/
Copy pathpr-title.yml
File metadata and controls
68 lines (63 loc) · 2.02 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# =============================================================================
# PR Title Validation
# =============================================================================
# Validates PR titles using Conventional Commits (semantic-release friendly).
# This repo uses **Squash and merge**, so the PR title becomes the release commit.
# Keeping titles compliant ensures correct version bumps and clean changelogs.
#
# Title requirements:
# - Format: <type>(<scope>): <subject>
# - Subject: lowercase, no trailing period, <= 100 chars total header
# - Scope: optional; if present must be one of the allowed scopes below
#
# Format: <type>(<scope>): <subject>
# Example: feat(website): add dark mode toggle
# =============================================================================
name: PR Title
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
pull-requests: read
statuses: write
jobs:
validate:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Types allowed in PR titles (Angular convention)
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
# Require scope to be provided
requireScope: false
# Scopes allowed (empty = any scope allowed)
scopes: |
website
docs
deps
cli
# Ensure subject doesn't start with uppercase
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the PR title "{title}"
should not start with an uppercase character.
# Allow WIP PRs
wip: true
# Validate single commit PRs
validateSingleCommit: false