-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pull request title validator (#126)
- Loading branch information
1 parent
5c15020
commit 194bf0b
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- ## Title Guidelines | ||
A title always has a prefix and a subject. | ||
### Prefix | ||
Make sure the title is prefixed with one of the following: | ||
| Prefix | When to use | | ||
|--------|-------------| | ||
| `feat:` | New feature | | ||
| `fix:` | Bug fix | | ||
| `docs:` | Documentation only changes | | ||
| `style:` | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | | ||
| `refactor:` | Code changes that neither fixes a bug nor adds a feature | | ||
| `perf:` | Code change that improves performance | | ||
| `test:` | Adding missing or correcting existing tests | | ||
| `chore:` | Changes to the build process or auxiliary tools and libraries such as documentation generation, ci, etc | | ||
### Subject | ||
Ensure the subject contains succinct description of the change. | ||
* Use the imperative, present tense: "change", not "changed" nor "changes" | ||
* Don’t capitalize first letter | ||
* No dot (.) at the end | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Pull Request Title Validator" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
# Ensure PR title matches Angular Commit Guidelines | ||
validate-pr-title: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
with: | ||
subjectPattern: ^(?![A-Z]).+(?<!\.)$ | ||
subjectPatternError: | | ||
The subject "{subject}" found in the pull request title "{title}" | ||
didn't match the configured pattern. Please ensure that the subject | ||
doesn't start with an uppercase character and doesn't end with a period. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |