Skip to content

NickCirv/pr-guard

Repository files navigation

pr-guard

Block bad PRs before they waste reviewer time — commits, secrets, conflicts, and more

License: MIT Node.js GitHub Action

Install

# GitHub Action (recommended)
uses: NickCirv/pr-guard@v1

# CLI
npx github:NickCirv/pr-guard

Usage

# Run all checks on the current branch
npx github:NickCirv/pr-guard

# Run a specific check
npx github:NickCirv/pr-guard --check commits

# Strict mode — warnings become failures
npx github:NickCirv/pr-guard --strict

# JSON output for scripting
npx github:NickCirv/pr-guard --json

# Generate a config template
npx github:NickCirv/pr-guard init
Flag Description
--check <name> Run one check: commits, branch, description, files, conflicts, labels
--config <path> Path to .prguard.yml
--branch <name> Override git branch detection
--description <text> Override PR description
--strict Treat warnings as failures (exit 1)
--json Machine-readable output

GitHub Action

name: PR Guard
on:
  pull_request:
    types: [opened, synchronize, edited]

jobs:
  guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: NickCirv/pr-guard@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

What it does

PR Guard runs automated quality checks on a pull request before any human reads it. It validates branch naming conventions, enforces conventional commits, checks PR description length, detects secrets and forbidden files, scans for unresolved merge conflict markers, and enforces file count and size limits. Works as a zero-config GitHub Action or a local CLI — drop a .prguard.yml in your repo root to customise any threshold.


Node ≥18 · MIT · by NickCirv

About

PR quality gate — enforce commits, branch names, secrets detection, and file limits before review

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors