Skip to content

:octocat: Github Action! Enforce conventional commit format for commit and PR titles with clear error output ✅

License

Notifications You must be signed in to change notification settings

aisevim/commit-harmonizer-action

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

Commit Harmonizer

Tests GitHub tag (latest by date)

Enforce conventional commit format for Commit and PR titles with clear error output

Inputs

Input Description Required Default
github-token Token for repository access true
check-pr-title Enable PR title checking false true
check-commits Enable last commit message checking false true
bypass-checks A regex to bypass checks false ^wip|Wip|Merge|Revert|revert

Usage

On PR Title Edit and Last Commit Change

name: Pull Request Message Checker

on:
  pull_request:
    types:
      - edited
      - opened
      - synchronize
      - reopened

jobs:
  check-commit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Check Commit Message
        uses: aisevim/commit-harmonizer-action
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

On PR Title Edit

name: Pull Request Title Checker

on:
  pull_request:
    types:
      - edited


jobs:
  check-commit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Check Commit Message
        uses: aisevim/commit-harmonizer-action
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          check-commits: false

On Last Commit Change and disable bypass

name: Pull Request Commit Message Checker

on:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened


jobs:
  check-commit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Check Commit Message
        uses: aisevim/commit-harmonizer-action
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          check-pr-title: false
          bypass-checks: ".+"

Outputs Examples

Log example-1

Log example-2

Log example-3

License

This project is licensed under the MIT License.

Release Notes

See CHANGELOG.md for details on each release.