From 15b39ffc301e8c6a8500123cd7814e8dc4d46c05 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:03:07 -0700 Subject: [PATCH] ci: Add conventional commits validation (#1693) Validate pull request titles to ensure they adhere to conventional commits. This matches the validation performed in contrib. Co-authored-by: Matthew Wear --- .commit-me.json | 4 +++ .github/workflows/conventional-commits.yml | 32 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .commit-me.json create mode 100644 .github/workflows/conventional-commits.yml diff --git a/.commit-me.json b/.commit-me.json new file mode 100644 index 000000000..80224890c --- /dev/null +++ b/.commit-me.json @@ -0,0 +1,4 @@ +{ + "include-pull-requests": true, + "types": [ "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "release", "revert", "squash", "style", "test" ] +} diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 000000000..26cd79d03 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,32 @@ +name: Conventional Commits Validation + +on: + workflow_dispatch: + pull_request: + types: + - opened + - synchronize + - reopened + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request + cancel-in-progress: true # Cancel any previous runs of this workflow + +jobs: + validate-commits: + name: Conventional Commits Validation + runs-on: ubuntu-latest + steps: + - uses: dev-build-deploy/commit-me@v1.5.0 + env: + FORCE_COLOR: 3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + include-commits: false + update-labels: false + config: ".commit-me.json"