diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 871725c..6aef2b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ on: - 'renovate.json' - 'LICENSE' - '.gitignore' + - '.github/workflows/lint_pullrequest.yml' pull_request: paths-ignore: - '**.md' @@ -19,6 +20,7 @@ on: - 'renovate.json' - 'LICENSE' - '.gitignore' + - '.github/workflows/lint_pullrequest.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/lint_pullrequest.yml b/.github/workflows/lint_pullrequest.yml new file mode 100644 index 0000000..2425d81 --- /dev/null +++ b/.github/workflows/lint_pullrequest.yml @@ -0,0 +1,46 @@ +name: Lint Pull Request + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + pull-requests: read + statuses: write + +jobs: + semantic-pr: + name: Validate PR Title + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Validate PR Title + uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + requireScope: false + 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. + validateSingleCommit: true + validateSingleCommitMatchesPrTitle: true