DEV Community

RedSamerai
RedSamerai

Posted on

Stop Copy-Pasting Conventional Commits Rules: Auto-Fix Your Commits in CI

Why this exists

I keep hitting the same wall: my Conventional Commits check fails in CI, I push a fix commit, and that fix commit is itself in the wrong format. Then the PR title is 200 chars, the body is missing the Testing section, and in a monorepo my frontend package allows chore: but the backend doesn't — so I've been copy-pasting commitlint config into every repo.

Most linters stop at "tell you it's wrong." I wanted one that actually fixes it.

What I built

pr-conventional — a GitHub Action that enforces AND auto-fixes Conventional Commits, PR titles, and PR descriptions. It checks every new commit in the push (before..after, up to 20), the PR title, and the PR body.

What "auto-fix" means here

It's not "tell you it's wrong". On every push/PR it:

  1. Amends commit messages — fixes the type, adds a missing scope
  2. Appends missing PR-body sections (What / Why / Testing)
  3. Truncates over-long PR titles to your max
  4. Re-validates — only exits 0 when it's genuinely clean

This is the core of the tool, and it's in the FREE tier — no key needed.

Monorepo routing (the part that saves hours)

monorepo:
  packages:
    - path: "packages/frontend"
      rules:
        types: [feat, fix, docs, style, chore, test]
        scopeRegex: '^frontend[a-z0-9-]*$'
    - path: "packages/backend"
      rules:
        types: [feat, fix, refactor, test]
Enter fullscreen mode Exit fullscreen mode

A commit touching packages/frontend/a.ts is validated against the frontend rules. Touching both? It's checked against each rule set (strictest semantics, no intersection). Root-level / merge / shallow-clone files fall back to the root config. No copy-pasting five configs.

FREE vs PRO

Feature FREE (no key) PRO ($29 one-time)
Commit / PR validation + auto-fix + SARIF ✅ ✅
Whole-push check (before..after, not just HEAD) ✅ ✅
Monorepo per-package routing — ✅
Extends / remote rule packs — ✅

The FREE tier (MIT, no key) already gives you full validation, auto-fix, and SARIF using your repo's root config. PRO adds two things that scale to teams: per-package rule routing and remote rule-pack distribution.

SARIF out of the box

Every run writes pr-conventional.sarif. Pipe it into upload-sarif and findings land in the GitHub Security tab. No extra setup.

Install (30 seconds)

Drop a config into your repo, then call the action from any workflow:

# .github/workflows/pr-check.yml
jobs:
  pr-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
![Uploading image](...)
      - uses: RedSamerai/pr-conventional@v0.3.2
Enter fullscreen mode Exit fullscreen mode

Grab a starting point from the examples folder: strict.yml (zero-tolerance), relaxed.yml (personal repos, commit-only), monorepo.yml (per-package routing), chinese-team.yml (CN subjects, CN body sections).

Get the Pro license

PRO is a one-time $29 purchase, lifetime key — no subscription, no renewal. It unlocks monorepo routing and extends/remote rule packs. Get the Pro license → (delivered instantly).

Full docs · Marketplace listing

Top comments (0)