Skip to content

Validate git commit messages against conventional commit expectations.

License

Notifications You must be signed in to change notification settings

oliversalzburg/action-commit-validator

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 Validator Action

Pre-Release

Validate commit messages against Conventional Commits expectations.

Usage

Call the action from a workflow.

name: Pull Request

on:
  pull_request:

jobs:
  qa:
    runs-on: ubuntu-22.04
    permissions:
      contents: read

    steps:
      - uses: actions/checkout@v4
      - uses: oliversalzburg/[email protected]
        with:
          accept-breaking-changes: false
          accept-emoji: false
          accepted-scopes: |
            api
            build
            deps
            deps-dev
          accepted-types: |
            chore
            ci
            docs
            feat
            fix
            refactor
            test
          repo-token: ${{ secrets.GITHUB_TOKEN }}

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
accept-breaking-changes string false "true" Is the breaking change indicator
(!) allowed?
accept-emoji string false "true" Are emoji allowed?
accepted-scopes string false Only accept these scopes. Provide
as multi-line string, each type
on it's own line. By
default, all scopes are accepted.
accepted-types string false "feat"
"fix"
Only accept these type prefixes.
Provide as multi-line string, each
type on it's own line.
repo-token string true Needs secrets.GITHUB_TOKEN to talk to
the API.
require-conventional string false "true" Require all commits to follow
the Conventional Commits specification
require-scope string false "false" Require all commits to specify
a scope.

Release Process

npm version patch --message "chore: Version bump %s"