Skip to content

dev-build-deploy/commit-me

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

CommitMe

CommitMe provides a Pre-commit hook, GitHub Action, and Command Line Interface for:

  • Adding labels (feature, fix, or breaking) to your Pull Request
  • Limiting Conventional Commits scope and types.

Pre-commit hook

You can add CommitMe as a pre-commit by:

  1. Installing pre-commit
  2. Including CommitMe in your .pre-commit.config.yaml file, e.g.:
repos:
- repo: https://github.com/dev-build-deploy/commit-me
  rev: v0.12.0
  hooks:
  - id: commit-me
  1. Installing the commit-msg hooks
$ pre-commit install --hook-type commit-msg 

CICD Validation (GitHub Action)

The basic workflow can be set up as such:

name: Conventional Commits
on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize

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

permissions:
  contents: read  # NOTE; you will need to change this permission to `write` in case you do not provide the `include-commits` input parameter.
  pull-requests: write  # OPTIONAL; only required when you want CommitMe to update labels in your Pull Request, set `update-labels` to `false` if you do not require this feature.

jobs:
  commit-me:
    name: Conventional Commits Compliance
    runs-on: ubuntu-latest
    steps:
      - uses: dev-build-deploy/commit-me@v0
        with:
          token: ${{ github.token }}  # Required to retrieve the commits associated with your Pull Request
          include-commits: true  # OPTIONAL; forces the inclusion of commits associated with your Pull Request
        env:
          # Enable colored output in GitHub Actions
          FORCE_COLOR: 3

You can find more details in the dedicated documentation

Local Development (Command Line Interface)

Performing local validation is as simple as running the check command:

$ commit-me check

You can find more details in the dedicated documentation

Contributing

If you have suggestions for how commit-me could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License