Skip to content

Recapture on main instead of holding branches up to date - #34

Merged
ariofrio merged 1 commit into
mainfrom
ariofrio/recapture-on-main-instead
Aug 25, 2026
Merged

Recapture on main instead of holding branches up to date#34
ariofrio merged 1 commit into
mainfrom
ariofrio/recapture-on-main-instead

Conversation

@ariofrio

@ariofrio ariofrio commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Screenshots now runs on main as well as on pull requests, so a branch that merges without recapturing is corrected there. A branch no longer has to be up to date with main to merge.

Motivation

Strict required checks meant every merge invalidated every other open pull request. With several branches open at once they serialised behind each other, each update re-running a full capture.

Changes

The recapture on main is pushed with a deploy key. GitHub Actions cannot be a bypass actor on a repository a person owns, so the workflow's own token cannot write to main.

Settings changed alongside the diff:

Protect main bypass DeployKey, mode always
strict_required_status_checks_policy off
Deploy key "Screenshots recapture", write
Secret SCREENSHOTS_DEPLOY_KEY

Trade-offs

Each recapture on main starts one more Screenshots run, because a deploy key's push is not the token's. It stops at the relevance step in about 70 seconds, since affects.mjs does not list assets/**.

Main can hold stale screenshots between a merge and the recapture that follows, roughly the length of one capture. The previous arrangement prevented that by making every other branch pay for it.

@ariofrio
ariofrio enabled auto-merge (squash) August 25, 2026 04:19
Requiring every branch to be up to date with main before merging made each
merge invalidate every other open pull request, and with several open at once
they serialised behind each other, re-running a full capture each time.

Screenshots now also runs on main, so a branch that merges without recapturing
is corrected there. The push uses a deploy key: GitHub Actions cannot be a
bypass actor on a repository a person owns, so the workflow's own token cannot
write to main. Protect main lets a deploy key through, and its bypass list
offers one.

The relevance step asks the compare API what a push replaced, the way it
already asks the files API what a pull request changed, so neither path needs
a deep checkout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ariofrio
ariofrio force-pushed the ariofrio/recapture-on-main-instead branch from d88ac67 to e64030e Compare August 25, 2026 04:33
@ariofrio
ariofrio merged commit 32b5f54 into main Aug 25, 2026
11 checks passed
@ariofrio
ariofrio deleted the ariofrio/recapture-on-main-instead branch August 25, 2026 04:37
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