From 09751547e385595795e0d4b586b0be98c9570312 Mon Sep 17 00:00:00 2001 From: Ian Lewis Date: Tue, 10 Jan 2023 06:48:08 +0000 Subject: [PATCH] Add PR title checker Signed-off-by: Ian Lewis --- .github/pr-title-checker-config.json | 14 ++++++++++++++ .github/workflows/pre-submit.pr-title.yml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .github/pr-title-checker-config.json create mode 100644 .github/workflows/pre-submit.pr-title.yml diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 0000000000..9e65fd9364 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,14 @@ +{ + "LABEL": { + "name": "title needs adjustment", + "color": "EEEEEE" + }, + "CHECKS": { + "regexp": "^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*" + }, + "MESSAGES": { + "success": "PR title is valid", + "failure": "PR title is invalid", + "notice": "Title needs to pass regex '^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*" + } +} diff --git a/.github/workflows/pre-submit.pr-title.yml b/.github/workflows/pre-submit.pr-title.yml new file mode 100644 index 0000000000..0f6c41caba --- /dev/null +++ b/.github/workflows/pre-submit.pr-title.yml @@ -0,0 +1,14 @@ +name: PR Title + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@e914bff8ab5e6f1a6a270da6954cd6bfd1d7f1fb # v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + configuration_path: ".github/pr-title-checker-config.json"