Skip to content

Adding commitlint to this repo

The new actions-ci workflow, which is based off of commitlint (commitlint GitHub), has been added in an effort to enforce good git hygiene.

The workflow originated from the CI setup GitHub Actions section of the commitlint guides. The example workflow needed to be updated in order to run, but it should be working now.

The default commitlint configuration:

module.exports = {
    extends: [
        "@commitlint/config-conventional"
    ],
}

Enforcing good git hygiene

Part of ensuring proper commit messages (and pull requests) will help with automating releases. For example, the semantic release tool can be used in a GitHub action, via this semantic-release-action.

Here are some other write-ups on the topic: - https://www.vantage-ai.com/blog/how-to-enforce-good-pull-requests-on-github - https://hugooodias.medium.com/the-anatomy-of-a-perfect-pull-request-567382bb6067

Resources

commitlint guide links: - Guide: Getting started - Guide: Local setup - Guide: CI Setup

Actions that can be used with commitlint: - https://github.com/webiny/action-conventional-commits - https://github.com/wagoid/commitlint-github-action - https://github.com/commitizen/conventional-commit-types - https://github.com/amannn/action-semantic-pull-request - (deprecated) https://github.com/squash-commit-app/squash-commit-app - (deprecated) https://github.com/zeke/semantic-pull-requests

Examples with a semantic.yml file within a GitHub repo: - https://github.com/GoogleChrome/lighthouse-ci/blob/main/.github/semantic.yml - https://github.com/minecrafthome/minecrafthome/blob/master/semantic.yml - https://github.com/meltano/sdk/blob/main/.github/semantic.yml - https://github.com/vectordotdev/vector/blob/master/.github/semantic.yml

Here are links to other resources: - https://github.blog/changelog/2022-05-11-default-to-pr-titles-for-squash-merge-commit-messages/ - https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions - https://jamiewen00.medium.com/integrate-commitlint-to-your-repository-67d6524d0d24 - https://ajcwebdev.com/semantic-github/