Skip to content

Commit

Permalink
ci: adjust the regex of validating PR title (#479)
Browse files Browse the repository at this point in the history
* ci: adjust the regex of validating PR title

Signed-off-by: Lin Yang <[email protected]>

* docs: update comment of invalid PR title

Signed-off-by: Lin Yang <[email protected]>

---------

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh authored Nov 26, 2024
1 parent 484750d commit 0017e0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/pr-title-checker-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["[Bot] docs: "],
"regexp": "^(feat|fix|docs|test|ci|chore|refactor|perf)!?(\\(.*\\))?!?:.*"
"regexp": "^(\\[WIP\\]|\\[BACKPORT\\]|\\[CHERRY-PICK\\])?( )?(feat|fix|docs|build|test|ci|chore|refactor|perf)!?(\\(.*\\))?!?:.*"
},
"MESSAGES": {
"success": "PR title is valid",
"failure": "PR title is invalid",
"notice": "PR Title needs to pass regex '^(feat|fix|docs|test|ci|chore|refactor|perf)!?(\\(.*\\))?!?:.*"
"notice": "PR Title needs to pass regex '^(\\[WIP\\]|\\[BACKPORT\\]|\\[CHERRY-PICK\\])?( )?(feat|fix|docs|build|test|ci|chore|refactor|perf)!?(\\(.*\\))?!?:.*'"
}
}
6 changes: 5 additions & 1 deletion .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Lint PR"

on:
pull_request_target:
types: [opened, edited, reopened, synchronize]
types: [opened, edited, reopened, synchronize, labeled, unlabeled]


# IMPORTANT: No checkout actions, scripts, or builds should be added to this workflow. Permissions should always be used
Expand Down Expand Up @@ -46,6 +46,10 @@ jobs:
* `chore: update dependencies AB#456`
* `feat: add new feature AB#789`
* `chore: fixing build pipeline` - no AB reference
* `build(deps): bump BlahBlah from 1.0 to 1.1`
* `[WIP] feat: add new feature AB#123`
* `[CHERRY-PICK] fix: fix typo in README.md AB#123`
* `[BACKPORT] fix: fix typo in README.md AB#123`
For more details, please refer to the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0)
and the [PR Title Configuration File](.github/pr-title-checker-config.json).
Expand Down

0 comments on commit 0017e0c

Please sign in to comment.