-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f72533c
commit 50dfcc8
Showing
2 changed files
with
14 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -15,22 +15,23 @@ | |
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: "PR Title Checker" | ||
name: Check PR Title | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
|
||
jobs: | ||
check: | ||
check-pr-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: thehanimo/[email protected] | ||
- name: Check Title | ||
uses: actions/github-script@v5 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
pass_on_octokit_error: false | ||
configuration_path: .github/pr-title-checker-config.json | ||
script: | | ||
const title = context.payload.pull_request.title; | ||
const regex = /^(feat|fix|docs|refactor|chore)(\(.\+\))?!?: .+$/; | ||
if (!regex.test(title)) { | ||
core.setFailed('PR title does not follow the convention, the pattern: ^(feat|fix|docs|refactor|chore)(\(.\+\))?!?: .+$'); | ||
} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |