build: add PR lint action (#10990)
This commit is contained in:
parent
193796ca16
commit
96a61e327e
|
|
@ -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."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -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 }}"
|
||||||
Loading…
Reference in New Issue