Open davidzlu opened 5 days ago
This is a great idea! Here's some additional resources I found that we can look into.
Conventional Commit Spec - Spec mentioned throughout actions listed below.
Customizable Conventional Commits: This action ensures all commit messages follow the Conventional Commits spec. You can tweak the allowed commit types to fit a project’s needs. 
Conventional Commits PR: This action validates pull request titles against the Conventional Commits preset. This is useful for squash merges.
Conventional PR Title: Checks that PR titles match the Conventional Commits spec. Helpful when using semantic-release with the Conventional Commits preset. 
Conventional Commits GitHub Action: Verifies all commit messages adhere to the Conventional Commits specification.
To set up any of these actions, add a workflow file in .github/workflows directory. Example using the Customizable Conventional Commits action:
name: Conventional Commits
on:
pull_request:
branches:
- main
jobs:
build:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gentleseal/action-conventional-commits@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
This setup will check that all commit messages in your pull requests follow the Conventional Commits standard. You can customize the valid-commit-types parameter to specify which commit types are allowed.
The project uses conventional commits, but style is currently enforced only through code reviews. Integrating more automation into this would standardize the commit message style, and allow contributors and reviewers to focus on code over process.
One library that could implement this is: https://github.com/qoomon/git-conventional-commits