From 99aa49e52739de0bb0fdd0408b9bad1758414875 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Mon, 21 Sep 2020 19:27:23 -0700 Subject: [PATCH 1/4] 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 }} From df987cc2fd3d578cb3d55bf51462644757525604 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Mon, 21 Sep 2020 20:28:20 -0700 Subject: [PATCH 2/4] fixes commenting? --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 6dbf207ca3fd9..17f310d220d35 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ name: PR Lint on: - pull_request: + pull_request_target: # 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. # From c3812ebc588f777c6b62b25e13c87cbb660b6c22 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Mon, 21 Sep 2020 20:36:35 -0700 Subject: [PATCH 3/4] revert pull_request_target --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 17f310d220d35..6dbf207ca3fd9 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ name: PR Lint on: - pull_request_target: + 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. # From e1b52d37c08e644222d431ef21d0a6f385eae9a2 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Mon, 21 Sep 2020 20:43:58 -0700 Subject: [PATCH 4/4] fix regex --- .github/workflows/pr-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 6dbf207ca3fd9..ec4926d075dc0 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -14,9 +14,9 @@ jobs: steps: - uses: morrisoncole/pr-lint-action@v1.3.0 with: - title-regex: ^(build|chore|ci|docs|feat|fix|perf|refactor|style|test|other)((.+))?:\\s.+ + 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 }} + repo-token: "${{ secrets.GITHUB_TOKEN }}"