From e81903c445281d3698a1227c4942a115e237b702 Mon Sep 17 00:00:00 2001 From: harmeetsingh11 Date: Wed, 5 Feb 2025 00:45:25 +0530 Subject: [PATCH 1/2] feat: add workflow for PR title checker --- .github/workflows/pr-title-checker.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-title-checker.yml diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 0000000..3dad82d --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,19 @@ +name: 'PR Title Checker' +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@v1.3.7 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false + configuration_path: '.github/pr-title-checker.json' From 4499c726e84cfe8d8b2c1e9d9ef44187e5d5109a Mon Sep 17 00:00:00 2001 From: harmeetsingh11 Date: Wed, 5 Feb 2025 00:45:39 +0530 Subject: [PATCH 2/2] feat: add JSON file for PR title checker --- .github/pr-title-checker.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/pr-title-checker.json diff --git a/.github/pr-title-checker.json b/.github/pr-title-checker.json new file mode 100644 index 0000000..68385a3 --- /dev/null +++ b/.github/pr-title-checker.json @@ -0,0 +1,25 @@ +{ + "LABEL": { + "name": "title needs formatting", + "color": "F9D0C4" + }, + "CHECKS": { + "prefixes": [ + "build: ", + "chore: ", + "docs: ", + "feat: ", + "fix: ", + "perf: ", + "refactor: ", + "revert: ", + "style: ", + "test: " + ] + }, + "MESSAGES": { + "success": "Everything is great. Status: 200", + "failure": "PR title does not conform to the required format. Please use one of the specified prefixes followed by a colon and a space. Status: 400", + "notice": "" + } + }