Skip to content

Commit 18fb484

Browse files
jland-redhatJaland
andauthored
Adding workflow for common commits (#128)
Co-authored-by: Jamie Land <hokie10@gmail.com>
1 parent 37d4b6b commit 18fb484

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: PR Title Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
validate-pr-title:
13+
name: Validate PR Title
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
21+
- name: Validate PR Title Format
22+
uses: amannn/action-semantic-pull-request@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
# Configure the allowed types
27+
types: |
28+
feat
29+
fix
30+
docs
31+
style
32+
refactor
33+
perf
34+
test
35+
build
36+
ci
37+
chore
38+
revert
39+
# Allow breaking changes
40+
requireScope: false
41+
# Allow empty scope
42+
allowMergeCommits: true
43+
# Disable validation for draft PRs
44+
ignoreLabels: |
45+
draft
46+
wip
47+
# Configure the subject pattern
48+
subjectPattern: ^(?![A-Z]).+$
49+
subjectPatternError: |
50+
The subject "{subject}" found in the pull request title "{title}" didn't match the configured pattern. Please ensure that the subject doesn't start with a capital letter.
51+
# Configure the subject pattern error
52+
validateSingleCommit: false
53+
# Configure the body pattern (optional)
54+
bodyPattern: ^.*$
55+
bodyPatternError: |
56+
The pull request body didn't match the configured pattern.
57+
# Configure the body pattern error
58+
ignoreLabelsForTitle: |
59+
draft
60+
wip
61+
# Configure the body pattern error
62+
ignoreLabelsForBody: |
63+
draft
64+
wip

0 commit comments

Comments
 (0)