Skip to content

Docs-only PR fast path: auto-approve bot for markdown + graphics - #371

Open
IPvSean wants to merge 3 commits into
ansible:mainfrom
IPvSean:proposal/docs-only-pr-fast-path
Open

IPvSean wants to merge 3 commits into
ansible:mainfrom
IPvSean:proposal/docs-only-pr-fast-path

Conversation

@IPvSean

@IPvSean IPvSean commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Implements option B: a deterministic GitHub Action that auto-approves PRs whose changed files are only markdown / graphics (no AI).
  • Keeps classic "1 approving review" branch protection; the bot supplies that approval for docs-only PRs via a GitHub App.
  • Updates the proposal + CONTRIBUTING.md to match Chris's suggestion (.md + images, RHDP-style bot).

How it works

.github/workflows/docs-only-auto-approve.yml on pull_request_target:

  1. Lists PR files via API (never checks out PR head).
  2. Eligible iff every path matches *.md / *.png / *.jpg / *.jpeg / *.gif / *.webp / *.svg.
  3. Mints an App token and gh pr review --approve, plus label docs-only.

Admin follow-up (required for approvals to count)

  1. Create/install GitHub App apd-docs-approver (Pull requests: Read & write) on ansible/product-demos.
  2. Set secrets APD_DOCS_APPROVER_APP_ID and APD_DOCS_APPROVER_APP_PRIVATE_KEY.
  3. Until secrets exist, docs-only PRs get a one-time comment that auto-approve is not configured yet.

Details: .github/proposals/docs-only-pr-fast-path.md.

Test plan

  • Repo admin configures the App + secrets
  • Markdown-only PR → docs-only label + bot APPROVE + mergeable with green CI
  • Markdown + YAML PR → no auto-approve
  • Graphics-only PR (e.g. .png) → auto-approve
  • Fork PR still only uses API (no untrusted checkout)

Document a path-aware GitHub ruleset approach so markdown-only changes can merge faster while playbooks and setup YAML stay behind normal review.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jce-redhat

jce-redhat commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

good idea. we should investigate using a bot to auto-approve docs-only PRs, sort of like the RHDP team does with agnosticv. PRs that only have .md files and graphics (.png, .jpg, etc.) would be eligible.

IPvSean and others added 2 commits November 11, 2026 11:35
Add a pull_request_target workflow that approves markdown/graphics-only
PRs via a GitHub App, and retarget the proposal/CONTRIBUTING docs to
that approach instead of a path-aware ruleset alone.

Co-authored-by: Cursor <cursoragent@cursor.com>
@IPvSean

IPvSean commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Went with option B (auto-approve Action), per @jce-redhat's note.

Shipped on this PR:

  • .github/workflows/docs-only-auto-approve.yml — path filter for .md + graphics; GitHub App approve (no AI)
  • Proposal + CONTRIBUTING.md updated to that model

Still needs a one-time admin step: create/install the docs-approver App and set APD_DOCS_APPROVER_APP_ID / APD_DOCS_APPROVER_APP_PRIVATE_KEY so the approval counts toward branch protection.

@IPvSean IPvSean changed the title Proposal: docs-only PR fast path (no second-person review for markdown) Docs-only PR fast path: auto-approve bot for markdown + graphics Nov 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants