Skip to content

ci: take screenshots for new live sites weekly and propose them as a PR - #3

Merged
kanywst merged 7 commits into
mainfrom
feat/auto-shots
Oct 23, 2026
Merged

kanywst merged 7 commits into
mainfrom
feat/auto-shots

Conversation

@kanywst

@kanywst kanywst commented Oct 23, 2026

Copy link
Copy Markdown
Member

A new repo with a live site shows up on the desk as a blank sheet until someone adds its screenshot by hand. This takes those screenshots automatically.

  • scripts/shoot.ts opens each site on the org's Pages origin at 1280×800 with reduced motion and saves src/assets/shots/<repo>.png. By default it only shoots repos that have no screenshot yet, so existing prints don't churn every week. Pass --all to retake every one.
  • shots.yml runs every Monday, and by hand with a "retake all" switch. It syncs the current repo list first, because the committed repos.json can lag behind the org. It runs in the same Playwright image as e2e and opens a PR when anything changed.
  • A PR opened with the workflow token does not start CI by itself, and the PR body says so: close and reopen it to run CI before merging.

Also changed outside this diff: the repo's default workflow token permission is now read. Every workflow here already declares the permissions it needs.

Tested locally: with one screenshot removed, the script took exactly that one (1280×800) and kept the other 7.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39e534aa-096c-42fe-b030-b3b4229d8edf
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@claude

claude Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Clean against the checklist. This PR only adds shots.yml, scripts/shoot.ts and README text, and it touches no desk, CSP, readme-parsing or sync code. The shoot and propose jobs are split by privilege, the artifact is limited to real PNGs directly inside src/assets/shots, the redirect check runs after the page settles, and the Playwright image tag is pinned to an exact version.

Comment thread scripts/shoot.ts Outdated
Comment thread scripts/shoot.ts Outdated
kanywst added a commit that referenced this pull request Oct 23, 2026
…n summary

A 404 or 5xx page was screenshotted like any other, and without --all it would
never be retaken. Failed shots now also emit an Actions warning.

Raised in Claude review on #3.
Comment thread .github/workflows/shots.yml
Comment thread scripts/shoot.ts
kanywst added a commit that referenced this pull request Oct 23, 2026
…ect off-origin

The npm install and the sync ran in the job holding contents and pull-request
write. Shooting now runs read-only and hands the screenshots to a propose job
that installs nothing. A homepage that redirects elsewhere is no longer printed.

Raised in Claude review on #3.
Comment thread .github/workflows/shots.yml Outdated
A new repo with a live site sat on the desk as a blank sheet until someone
added its screenshot by hand. shots.yml syncs the current repo list, shoots
only what is missing (or everything with 'retake all'), and opens a PR.
…n summary

A 404 or 5xx page was screenshotted like any other, and without --all it would
never be retaken. Failed shots now also emit an Actions warning.

Raised in Claude review on #3.
…ect off-origin

The npm install and the sync ran in the job holding contents and pull-request
write. Shooting now runs read-only and hands the screenshots to a propose job
that installs nothing. A homepage that redirects elsewhere is no longer printed.

Raised in Claude review on #3.
Comment thread scripts/shoot.ts
Comment thread .github/workflows/shots.yml Outdated
Comment thread scripts/shoot.ts Outdated
@kanywst
kanywst merged commit 179ba78 into main Oct 23, 2026
8 checks passed
kanywst added a commit that referenced this pull request Oct 23, 2026
…n summary

A 404 or 5xx page was screenshotted like any other, and without --all it would
never be retaken. Failed shots now also emit an Actions warning.

Raised in Claude review on #3.
kanywst added a commit that referenced this pull request Oct 23, 2026
…ect off-origin

The npm install and the sync ran in the job holding contents and pull-request
write. Shooting now runs read-only and hands the screenshots to a propose job
that installs nothing. A homepage that redirects elsewhere is no longer printed.

Raised in Claude review on #3.
@kanywst
kanywst deleted the feat/auto-shots branch October 23, 2026 19:34
kanywst added a commit that referenced this pull request Oct 23, 2026
kanywst added a commit that referenced this pull request Oct 23, 2026
kanywst added a commit that referenced this pull request Oct 23, 2026
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.

1 participant