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