diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml new file mode 100644 index 00000000..e08845a8 --- /dev/null +++ b/.github/workflows/semantic-pr.yml @@ -0,0 +1,49 @@ +name: Semantic PR + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + validate: + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed (https://github.com/commitizen/conventional-commit-types) + types: | + fix + feat + docs + style + refactor + perf + test + build + ci + chore + revert + # Configure which scopes are allowed (optional) + # scopes: | + # core + # msgs + # tests + # Require a scope to be provided + requireScope: false + # Disable validation of commits (only validate PR title) + validateSingleCommit: false + # Allow subject to start with uppercase + subjectPattern: ^(?![A-Z]).+$ + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + doesn't start with an uppercase character.