Skip to content

dongmin-dev/github-pr-capture

Repository files navigation

GitHub PR Capture

Utility scripts for producing clean, transparent-background screenshots of GitHub pull-request conversations using Puppeteer. Two variants are provided: a lightweight capture for public pages and a session-aware capture that preserves the merge box.

Prerequisites

  • Node.js 18+
  • Google Chrome or Chromium (bundled with Puppeteer)
  • Optional: a GitHub account to authenticate when using the merge-aware flow.

Install dependencies once:

npm install

Scripts

1. capture-pr-comments.js

Run against any PR:

node capture-pr-comments.js https://github.com/owner/repo/pull/123

If no URL is provided, it defaults to the example PR inside the script.

2. capture-pr-comments-with-merge.js

Usage:

node capture-pr-comments-with-merge.js https://github.com/owner/repo/pull/123

On first run you will be prompted to log in manually; subsequent executions reuse the session.

Output

  • pr-comments.png — screenshot produced by the lightweight script.
  • pr-comments-with-merge.png — screenshot including tabs and merge box.

Both renders use transparent backgrounds so they can be overlaid onto slides or documents.

Tips

  • Increase viewport height limits via MAX_VIEWPORT_HEIGHT in capture-pr-comments.js or CONFIG.maxViewportHeight in capture-pr-comments-with-merge.js when dealing with long threads.
  • Adjust CONFIG.preThemeDelay / CONFIG.postStyleDelay in capture-pr-comments-with-merge.js if styles apply too early or late on slower networks.
  • The .gitignore already omits temp/ and user_data/; keep screenshots or session files there to avoid accidental commits.

About

Produce clean, transparent-background screenshots of GitHub pull-request conversations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published