-
Notifications
You must be signed in to change notification settings - Fork 84
52 lines (48 loc) · 1.75 KB
/
pr-title-lint.yml
File metadata and controls
52 lines (48 loc) · 1.75 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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: PR Title Lint
on:
pull_request_target:
types: [opened, edited, synchronize, reopened]
permissions:
pull-requests: read
statuses: write
jobs:
pr-title-lint:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
# Pinned to commit SHA for supply chain security (CWE-829)
# Verify: gh api repos/amannn/action-semantic-pull-request/git/ref/tags/v5.5.3 --jq '.object.sha'
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (see https://github.com/commitizen/conventional-commit-types)
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
deps
# Configure which scopes are allowed (empty means all scopes are allowed)
scopes: |
# Configure whether a scope must be provided (false means scopes are optional)
requireScope: false
# For work-in-progress PRs you can typically use draft pull requests
# Instead of allowing WIP in the title
wip: true
# Configure validation of the subject line (title after type/scope)
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
must start with a lowercase letter.
# If the PR contains only a single commit, validate that its message matches the PR title
validateSingleCommit: false