Comfy-Org / Comfy-Org/ComfyUI_frontend

Bind screenshot update checkout and write-back to the PR repository and head SHA

Open
#17,256 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

Comment-triggered screenshot automation resolves only `pr.head.ref`, then checks out that ref in the base repository with a write-capable credential. A fork PR can use a branch name that also exists in the base repository; resolving only the name can select and update the wrong source branch.

Verified in [pr-update-website-screenshots.yaml](https://github.com/Comfy-Org/ComfyUI_frontend/blob/686a91971eccaec062b39830764b04e5d0aa8a03/.github/workflows/pr-update-website-screenshots.yaml): `Get PR info` outputs `pr.head.ref`, checkout omits `repository`, and the final push targets `origin HEAD:refs/heads/$TARGET_BRANCH`. Review the corresponding branch-only path in `pr-update-playwright-expectations.yaml` too.

Resolve the head repository owner/name, ref, and SHA from the live PR object. Reject fork write-back before checkout unless a separately authorized fork installation is explicitly supported. Check out the recorded SHA, verify the head still matches before writing, and fail safely if it has moved. Keep screenshot generation unprivileged and constrain the write-back to verified screenshot changes.

Acceptance:

- A fork PR with a branch name colliding with a base-repository branch is rejected before checkout/write-back.
- A same-repository PR uses the recorded head SHA; moving the PR head during generation prevents a stale write.
- Missing/deleted head repositories fail closed.
- Neither screenshot updater can silently fall back to a same-named base branch.

Upstream transfer for FE-2084. This is a workflow identity-boundary correction; no dispatch or write-back has been performed as part of this report.

Contributor guide

Open the contributing guide

Research direction

Start with .github/workflows/pr-update-website-screenshots.yaml, especially Get PR info, checkout, and the final push, then review the corresponding branch-only path in pr-update-playwright-expectations.yaml. Trace the live PR head repository, ref, and SHA through screenshot generation and write-back. Done means fork collisions, missing repositories, and moved heads fail closed, while same-repository updates write only verified screenshot changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.