From 99aa49e52739de0bb0fdd0408b9bad1758414875 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Mon, 21 Sep 2020 19:27:23 -0700 Subject: [PATCH] build: add PR lint action --- .github/prlint.json | 8 -------- .github/workflows/pr-lint.yml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) delete mode 100644 .github/prlint.json create mode 100644 .github/workflows/pr-lint.yml diff --git a/.github/prlint.json b/.github/prlint.json deleted file mode 100644 index c1f6927624c66..0000000000000 --- a/.github/prlint.json +++ /dev/null @@ -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." - } - ] -} diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000000000..6dbf207ca3fd9 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -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 }}