From 21347fd740a906a8ce8fec55347f58ac6e0224b6 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sat, 29 Jun 2024 22:53:45 +0100 Subject: [PATCH] ci: add semantic commit validator --- .github/workflows/lint-pr.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..c70997b --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,27 @@ +name: "Lint Pull Request 🐙" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate pull request title + runs-on: ubuntu-22.04 + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # If the PR only contains a single commit, the action will validate that + # it matches the configured pattern. + validateSingleCommit: true + # Related to `validateSingleCommit` you can opt-in to validate that the PR + # title matches a single commit to avoid confusion. + validateSingleCommitMatchesPrTitle: true