Gate PR bodies
Reject pull requests whose description is missing sections or still has placeholder text.
MON MOTHMA: Many Bothans died to bring us these plans. The least the courier can do is fill in the briefing form.
Add mediva to this repo: npm i -D mediva, write .github/pull_request_template.md as below, and add .github/workflows/mdv.yml running jamespacileo/mediva@v0.2.0 on pull_request. Before opening any PR, save its body to body.md and fix every finding from npx mdv check --pr body.md.
Starters are being rebuilt; write this by hand.
<!-- mdv: document title.pattern=/^(feat|fix|docs|chore|refactor|perf|test|build|ci)(\(.+\))?!?:\s.+/ -->
<!-- mdv: section required content.words.min=20 content.none=@placeholders -->
## Description
Describe what changed, why, and the impact.
<!-- mdv: section required issue.keyword=[Fixes, Closes, Resolves] -->
## Related Issue
Fixes #
<!-- mdv: section required -->
## Pre-Merge Checklist
<!-- mdv: list required items.all=checked labels.eq=@template -->
- [ ] I reviewed the diff for unrelated changes.
- [ ] I updated docs, or this PR does not require docs.## Description
Fixes stuff.
## Related Issue
Fixes #
## Pre-Merge Checklist
- [ ] I reviewed the diff for unrelated changes.
- [ ] I updated docs, or this PR does not require docs.npx mdv check --pr body.md --title "updated things"
gh pr view 123 --json body -q .body | npx mdv check --pr -A bad title, a thin Description and a bare Fixes # fail. Unticked boxes only warn; items. makes them block.
# .github/workflows/mdv.yml
name: mediva
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
jobs:
mediva:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jamespacileo/mediva@v0.2.0The Action reads the template from the PR's base commit, so a PR cannot loosen its own contract; the first PR that adds it passes with a notice. Inputs are on Mediva CI.
Variations
| Want | Add |
|---|---|
| not every box mandatory | checked. instead of items. |
| a single-select "Type of change" | checked. on a list leaf in its own section |
| visual evidence for UI work | a media required na leaf: an image or an explicit N/ |