Overlapping preview deployments can report another PR’s URL
Overlapping preview deployments can cause the deployment comment or summary to report another PR's preview URL, even while displaying the triggering run's commit SHA.
The preview workflow uses AdrianGonz97/refined-cf-pages-action@v1. Its getPagesDeployment() implementation fetches the project's deployments and takes the first result, without matching it to the deployment created by the current run. The action calls this again after a five-second delay and uses that deployment's alias in the PR comment. Another deployment arriving between these steps can therefore supply the reported URL.
Correction to the original diagnosis: the action already reads github.event.workflow_run.head_branch. Omitting the explicit branch input is not the cause, and adding it alone does not fix this race. The code supports a race in selecting the deployment to report; it does not establish that the artifact itself was deployed to the wrong branch. The original incident has not been confirmed from deployment logs.
#2736 replaces this action with Cloudflare's Wrangler action, removing the project-wide latest-deployment lookup. Any preview reporting should use the URL or ID returned by the specific deployment invocation. The earlier branch-only change in #2813 does not address this issue.
Source: huntabyte/shadcn-svelte