From 11ae23d5a2bc48bed6fa58805cd534c5e43db7fc Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Wed, 7 Feb 2024 23:14:07 -0600 Subject: [PATCH] ci: Add Conventional Commit Linter (#800) * ci: Add Conventional Commit Linter * squash: remove unused action * squash: Delete commitlint.config.js * squash: PR feedback * squash: Update contributing guide * squash: PR Feedback --- .commit-me.json | 4 +++ .github/workflows/conventional-commits.yaml | 32 +++++++++++++++++++++ CONTRIBUTING.md | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .commit-me.json create mode 100644 .github/workflows/conventional-commits.yaml 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.yaml b/.github/workflows/conventional-commits.yaml new file mode 100644 index 000000000..cc3a3ef71 --- /dev/null +++ b/.github/workflows/conventional-commits.yaml @@ -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.3.1 + env: + FORCE_COLOR: 3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + include-commits: false + update-labels: false + config: ".commit-me.json" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91c827411..a8a5fe37b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,7 +132,7 @@ merging. All commits to the main repository should follow the [conventional commit](https://conventionalcommits.org) standard. In a nutshell, this means commit messages should begin with a semantic tag such as `feat:`, -`fix:`, `docs:`, `tests:`, or `refactor:`. Our release tooling uses these tags +`fix:`, `docs:`, `test:`, `refactor:`, etc... Our release tooling uses these tags to determine the semantics of your commit, such as how it affects semantic versioning of the libraries, and to generate changelogs from commit descriptions. If you are not familiar with conventional commits, please review