GitHub - mogwi1983/policybot: PolicyBot - Commit Convention Enforcer. One GitHub Action that enforces Conventional Commits, PR title format, and PR description quality.

1 min read Original article ↗

One GitHub Action that enforces Conventional Commits, PR title format, and PR description quality. Zero config to start — add one line to your workflow.

Features

  • Conventional Commits — Validates every commit message follows type(scope): description
  • PR Title checking — Same grammar applied to the PR title
  • PR Description quality — Configurable minimum description length
  • Fork PR support — Works for PRs from forks (no secrets needed)
  • Customizable types — Configure which commit types are allowed
  • Repo-level config — Optional .github/policybot.yml for per-repo rules

Quick Start

Add to your .github/workflows/policybot.yml:

name: PolicyBot
on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: mogwi1983/policybot@v1
        with:
          github-token: ${{ github.token }}

That's it. Every PR will now be checked.

Configuration

Action Inputs

Input Default Description
github-token ${{ github.token }} Token for reading PR data
check-commits true Validate commit messages
check-pr-title true Validate PR title
min-description-length 0 Min PR body chars (0 = off)
allowed-types feat,fix,docs,... Allowed commit types

Repo-Level Config (.github/policybot.yml)

check_commits: true
check_pr_title: true
min_description_length: 50
allowed_types: feat,fix,docs,style,refactor,test,chore

Allowed Commit Types

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

License

MIT — see LICENSE.