Skip to content

Commit

Permalink
chore: improve template pr with suggestion title and add rule (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
Natalie9 authored Aug 5, 2024
1 parent 93aed71 commit 0f73ec8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
## Infos

<!--
### Pull Request Title Convention
When creating a Pull Request, please follow the title convention. It is essential that the title conforms to the standard as it will be used in the library's changelog description.
> type(context): description
The types should be:
- feat: for new features
- fix: for bug fixes
- chore: for maintenance tasks
- major: for major changes that generate a new version
- docs: for documentation
- ci: for chores about ci changes
Example:
> feat(component): create link component
-->

[Task](https://juntossomosmais.monday.com/boards/XXX/pulses/XXX)

#### What is being delivered?
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Title Check

on:
pull_request:
types: [opened]

jobs:
pr-title:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Validate PR Title
run: |
if [[ ! "${{ github.event.pull_request.title }}" =~ ^(feat|fix|chore|major|docs|ci))\([a-zA-Z0-9_-]+\):\ .+$ ]]; then
echo "The Pull Request title must follow the convention: 'type(context): description'."
"The types must be: feat, fix, chore, major."
echo "Example of a correct title: feat(component): create link component"
exit 1
fi

0 comments on commit 0f73ec8

Please sign in to comment.