⚙️ Post PR preview page screenshots to GitHub pull requests with Snapshot Site
⚡ 1 views · ⚙️ DevOps & CI/CD
💡 Pro Tip — If you need GitHub data beyond what the REST API gives you, ScraperNode has a repository scraper that extracts metadata at scale without token rate limits.
Description
Quick overview
This workflow receives a webhook from your CI when a pull request preview is deployed, screenshots only the changed preview routes using Snapshot Site, and posts a single GitHub pull request comment containing a summary table, embedded screenshots, and any capture failures.
How it works
- Receives a POST webhook from your CI with the GitHub owner, repository, PR number, preview base URL, and a list of changed page routes to capture.
- Validates the payload, builds full https:// URLs for each route, removes duplicates, and caps the run to a configurable maximum number of pages.
- Waits 30 seconds to let the preview deployment warm up.
- Iterates through the selected pages and calls Snapshot Site to capture full-page WebP screenshots at 1280px wide with cookie banners hidden.
- Records each capture result as success (with an image link) or failure (with an error message) without stopping the run when a page fails.
- Builds one GitHub-flavoured Markdown comment containing a results table, collapsible screenshot previews, and a “could not be captured” list, then posts it to the pull request as a single comment via GitHub.
Setup
- Install the verified community node
n8n-nodes-snapshot-siteand add Snapshot Site API credentials in n8n. - Add GitHub credentials with permission to create pull request comments (classic PAT with
repo, or a fine-grained token with Pull requests: Read and write for the target repository). - Activate the workflow, copy the Webhook node’s Production URL, and configure your CI/preview deployment job to POST
owner,repository,prNumber,previewUrl(including https://), and apages[]array of changed routes (optionallymaxPagesandcommit).
🔗 Nodes Used
GitHub, Webhook
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File