build: add PR lint action (#10990)

This commit is contained in:
ʈᵃᵢ 2020-09-21 21:21:04 -07:00 committed by GitHub
parent 193796ca16
commit 96a61e327e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

8
.github/prlint.json vendored
View File

@ -1,8 +0,0 @@
{
"title": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|style|test|other)((.+))?:\\s.+",
"message": "Your title needs to be prefixed with a topic."
}
]
}

22
.github/workflows/pr-lint.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: PR Lint
on:
pull_request:
# By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We
# explicity override here so that PR titles are re-linted when the PR text content is edited.
#
# Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
types: [opened, edited, reopened, synchronize]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: morrisoncole/pr-lint-action@v1.3.0
with:
title-regex: "^(build|chore|ci|docs|feat|fix|perf|refactor|style|test|other)((.+))?:\\s.+"
on-failed-regex-fail-action: true
on-failed-regex-create-review: true
on-failed-regex-comment:
"Please format your PR title to match: `%regex%`!"
repo-token: "${{ secrets.GITHUB_TOKEN }}"