1
+ name : " Validate PR title"
2
+
3
+ on :
4
+ pull_request_target :
5
+ types :
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs :
11
+ main :
12
+ name : Validate PR title
13
+ runs-on : ubuntu-22.04
14
+ steps :
15
+ # Please look up the latest version from
16
+ # https://github.com/amannn/action-semantic-pull-request/releases
17
+ # from https://github.com/amannn/action-semantic-pull-request/commits/main
18
+ - uses : amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb
19
+ env :
20
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21
+ with :
22
+ # Configure which types are allowed.
23
+ # Default: https://github.com/commitizen/conventional-commit-types
24
+ types : |
25
+ fix
26
+ feat
27
+ docs
28
+ chore
29
+ breaking
30
+ # Configure that a scope must always be provided.
31
+ requireScope : false
32
+ # Configure additional validation for the subject based on a regex.
33
+ # This example ensures the subject starts with an uppercase character.
34
+ subjectPattern : ^[A-Z].+$
35
+ # If `subjectPattern` is configured, you can use this property to override
36
+ # the default error message that is shown when the pattern doesn't match.
37
+ # The variables `subject` and `title` can be used within the message.
38
+ subjectPatternError : |
39
+ The subject "{subject}" found in the pull request title "{title}"
40
+ didn't match the configured pattern. Please ensure that the subject
41
+ starts with an uppercase character.
42
+ # For work-in-progress PRs you can typically use draft pull requests
43
+ # from Github. However, private repositories on the free plan don't have
44
+ # this option and therefore this action allows you to opt-in to using the
45
+ # special "[WIP]" prefix to indicate this state. This will avoid the
46
+ # validation of the PR title and the pull request checks remain pending.
47
+ # Note that a second check will be reported if this is enabled.
48
+ wip : true
49
+ # When using "Squash and merge" on a PR with only one commit, GitHub
50
+ # will suggest using that commit message instead of the PR title for the
51
+ # merge commit, and it's easy to commit this by mistake. Enable this option
52
+ # to also validate the commit message for one commit PRs.
53
+ validateSingleCommit : false
54
+ # Related to `validateSingleCommit` you can opt-in to validate that the PR
55
+ # title matches a single commit to avoid confusion.
56
+ validateSingleCommitMatchesPrTitle : false
0 commit comments