Skip to content

Commit e364a67

Browse files
chore: PR title check ensures uppercase is used in first character (#1774)
* chore: pr title check ensures uppercase is used in first char * include usage of third person
1 parent 54d0916 commit e364a67

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

.github/workflows/pull-request-lint.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pull-request-lint
22
on:
3-
pull_request_target:
3+
pull_request:
44
types:
55
- labeled
66
- opened
@@ -35,6 +35,12 @@ jobs:
3535
revert
3636
style
3737
requireScope: false
38+
# Ensures the subject start with an uppercase character.
39+
subjectPattern: ^([A-Z]).+$
40+
subjectPatternError: |
41+
The subject "{subject}" found in the pull request title "{title}"
42+
didn't match the configured pattern. Please ensure that the subject
43+
starts with an uppercase character.
3844
- uses: marocchino/sticky-pull-request-comment@v2
3945
# When the previous steps fails, the workflow would stop. By adding this
4046
# condition you can continue the execution with the populated error message.
@@ -46,7 +52,9 @@ jobs:
4652
4753
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
4854
49-
Details: [CONTRIBUTING.md](https://github.com/mongodb/awscdk-resources-mongodbatlas/blob/INTMDB-934/CONTRIBUTING.md#pr-title-format)
55+
Additionally, the subject of the title must start with an uppercase character (e.g. feat: New `search` component).
56+
57+
Details: [CONTRIBUTING.md](https://github.com/mongodb/awscdk-resources-mongodbatlas/blob/master/CONTRIBUTING.md#pr-title-format)
5058
5159
```
5260
${{ steps.lint_pr_title.outputs.error_message }}

CONTRIBUTING.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,25 @@ For more explained information about plugin override check [Development Override
6363
- A repo maintainer will review the your pull request, and may either request additional changes or merge the pull request.
6464

6565
#### PR Title Format
66-
We use [*Conventional Commits*](https://www.conventionalcommits.org/):
67-
- `fix: description of the PR`: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).
68-
- `chore: description of the PR`: the commit includes a technical or preventative maintenance task that is necessary for managing the product or the repository, but it is not tied to any specific feature or user story (this correlates with PATCH in Semantic Versioning).
69-
- `doc: description of the PR`: The commit adds, updates, or revises documentation that is stored in the repository (this correlates with PATCH in Semantic Versioning).
70-
- `test: description of the PR`: The commit enhances, adds to, revised, or otherwise changes the suite of automated tests for the product (this correlates with PATCH in Semantic Versioning).
71-
- `security: description of the PR`: The commit improves the security of the product or resolves a security issue that has been reported (this correlates with PATCH in Semantic Versioning).
72-
- `refactor: description of the PR`: The commit refactors existing code in the product, but does not alter or change existing behavior in the product (this correlates with Minor in Semantic Versioning).
73-
- `perf: description of the PR`: The commit improves the performance of algorithms or general execution time of the product, but does not fundamentally change an existing feature (this correlates with Minor in Semantic Versioning).
74-
- `ci: description of the PR`: The commit makes changes to continuous integration or continuous delivery scripts or configuration files (this correlates with Minor in Semantic Versioning).
75-
- `revert: description of the PR`: The commit reverts one or more commits that were previously included in the product, but were accidentally merged or serious issues were discovered that required their removal from the main branch (this correlates with Minor in Semantic Versioning).
76-
- `style: description of the PR`: The commit updates or reformats the style of the source code, but does not otherwise change the product implementation (this correlates with Minor in Semantic Versioning).
77-
- `feat: description of the PR`: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
78-
- `deprecate: description of the PR`: The commit deprecates existing functionality, but does not remove it from the product (this correlates with MINOR in Semantic Versioning).
66+
67+
A third person point of view is used when describing the changes made. Additionally, we use [*Conventional Commits*](https://www.conventionalcommits.org/) enforcing the subject of the title to start with a uppercase character:
68+
- `fix: Description of the PR`: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).
69+
- `chore: Description of the PR`: the commit includes a technical or preventative maintenance task that is necessary for managing the product or the repository, but it is not tied to any specific feature or user story (this correlates with PATCH in Semantic Versioning).
70+
- `doc: Description of the PR`: The commit adds, updates, or revises documentation that is stored in the repository (this correlates with PATCH in Semantic Versioning).
71+
- `test: Description of the PR`: The commit enhances, adds to, revised, or otherwise changes the suite of automated tests for the product (this correlates with PATCH in Semantic Versioning).
72+
- `security: Description of the PR`: The commit improves the security of the product or resolves a security issue that has been reported (this correlates with PATCH in Semantic Versioning).
73+
- `refactor: Description of the PR`: The commit refactors existing code in the product, but does not alter or change existing behavior in the product (this correlates with Minor in Semantic Versioning).
74+
- `perf: Description of the PR`: The commit improves the performance of algorithms or general execution time of the product, but does not fundamentally change an existing feature (this correlates with Minor in Semantic Versioning).
75+
- `ci: Description of the PR`: The commit makes changes to continuous integration or continuous delivery scripts or configuration files (this correlates with Minor in Semantic Versioning).
76+
- `revert: Description of the PR`: The commit reverts one or more commits that were previously included in the product, but were accidentally merged or serious issues were discovered that required their removal from the main branch (this correlates with Minor in Semantic Versioning).
77+
- `style: Description of the PR`: The commit updates or reformats the style of the source code, but does not otherwise change the product implementation (this correlates with Minor in Semantic Versioning).
78+
- `feat: Description of the PR`: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
79+
- `deprecate: Description of the PR`: The commit deprecates existing functionality, but does not remove it from the product (this correlates with MINOR in Semantic Versioning).
7980
- `BREAKING CHANGE`: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
8081
Examples:
81-
- `fix!: description of the ticket`
82+
- `fix!: Description of the ticket`
8283
- If the PR has `BREAKING CHANGE`: in its description is a breaking change
83-
- `remove!: description of the PR`: The commit removes a feature from the product. Typically features are deprecated first for a period of time before being removed. Removing a feature is a breaking change (correlating with MAJOR in Semantic Versioning).
84+
- `remove!: Description of the PR`: The commit removes a feature from the product. Typically features are deprecated first for a period of time before being removed. Removing a feature is a breaking change (correlating with MAJOR in Semantic Versioning).
8485

8586
### Testing the Provider
8687

0 commit comments

Comments
 (0)