Skip to content

Commit ff6c5e7

Browse files
ci: add conventional commit PR title linter
Add workflow to validate PR titles follow conventional commit format, ensuring automated version bumping works correctly with Release Please. Co-authored-by: dlevy-msft-sql <194277063+dlevy-msft-sql@users.noreply.github.com>
1 parent 3319690 commit ff6c5e7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
4+
name: PR Title Lint
5+
6+
on:
7+
pull_request:
8+
types: [opened, edited, synchronize, reopened]
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
pr-title-lint:
15+
name: Validate PR Title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
# Configure which types are allowed (see https://github.com/commitizen/conventional-commit-types)
23+
types: |
24+
feat
25+
fix
26+
docs
27+
style
28+
refactor
29+
perf
30+
test
31+
build
32+
ci
33+
chore
34+
revert
35+
deps
36+
# Configure which scopes are allowed (empty means all scopes are allowed)
37+
scopes: |
38+
# Configure that a scope must always be provided
39+
requireScope: false
40+
# For work-in-progress PRs you can typically use draft pull requests
41+
# Instead of allowing WIP in the title
42+
wip: true
43+
# Configure validation of the subject line (title after type/scope)
44+
subjectPattern: ^(?![A-Z]).+$
45+
subjectPatternError: |
46+
The subject "{subject}" found in the pull request title "{title}"
47+
must start with a lowercase letter.
48+
# If the PR contains only a single commit, validate that its message matches the PR title
49+
validateSingleCommit: false

0 commit comments

Comments
 (0)