diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..e0fc739c7 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,12 @@ +{ + "LABEL": { + "name": "", + "color": "EEEEEE" + }, + "CHECKS": { + "regexp": "(feat|fix|ci|chore|docs|test|refactor|revert)(\\([^\\)]+\\))?\\!?: .{1,}$|(?:Bump .+)$|^Release [0-9]+\\.[0-9]+\\.[0-9]+$|^Merge master into develop" + }, + "MESSAGES": { + "failure": "Invalid PR Title. Please use the following formats: 'commit type(area of change(optional)): Title'. Refer to the list of [conventional commit types](https://github.com/pvdlg/conventional-commit-types?tab=readme-ov-file#commit-types)." + } +} diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 000000000..2cd8bc2fa --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,17 @@ +name: "PR Title Checker" +on: + pull_request: + types: + - opened + - edited + +jobs: + check: + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@v1.4.3 + 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)