From 29f528a4ccaa89c4566d58e2b374afb4fbc417d6 Mon Sep 17 00:00:00 2001 From: Coull Date: Tue, 4 Jun 2024 13:20:10 -0700 Subject: [PATCH] infra: add pr_title_check workflow --- .github/pr-title-checker-config.json | 17 ++++++++++++++ .github/workflows/pr-title-checker.yml | 31 ++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/pr-title-checker-config.json create mode 100644 .github/workflows/pr-title-checker.yml diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..a1c37ac33 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,17 @@ +{ + "LABEL": { + "name": "title needs formatting", + "color": "EEEEEE" + }, + "CHECKS": { + "prefixes": ["fix: ", "feat: ", "test: ", "infra: ", "doc: ", "change: ", "break: ", "breaking: ", "deprecation: ", "feature: ", "depr: ", "documentation: "], + "regexp": "docs\\(v[0-9]\\): ", + "regexpFlags": "i", + "ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"] + }, + "MESSAGES": { + "success": "All OK", + "failure": "Failing CI test", + "notice": "" + } +} diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 000000000..a20344a77 --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,31 @@ +name: "PR Title Checker" + +on: + push: + branches: + - main + pull_request: + branches: + - main + - feature/** + pull_request_target: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +permissions: + pull-requests: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: "Check PR Title" + uses: thehanimo/pr-title-checker@v1.4.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false + configuration_path: .github/pr-title-checker-config.json #(optional. defaults to .github/pr-title-checker-config.json)