# GitHub Action (recommended)
uses: NickCirv/pr-guard@v1
# CLI
npx github:NickCirv/pr-guard# 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 |
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 }}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