From 1068b316b9f66fcaac8d9a4a27d356211009060f Mon Sep 17 00:00:00 2001 From: harmeetsingh11 Date: Wed, 24 Jan 2024 22:26:31 +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 bed8d40380dfdbf4fbd7ec77438f2e5f58e25281 Mon Sep 17 00:00:00 2001 From: harmeetsingh11 Date: Wed, 24 Jan 2024 22:26:54 +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..ba37ae9 --- /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": "" + } + } \ No newline at end of file