From 280d7b92311910e604631b9ff0d72772e150881e Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Fri, 24 Jul 2026 19:34:09 +0700 Subject: [PATCH] fix(ci): route the sticky comment by PR identity, not by list order The fork fallback took `prs[0]` from the commit's PR associations without checking any of them is still this run's head, so a stale association could collect another branch's report. Match on head sha, ref and repository, and skip when nothing matches. Verified against a synthesised association list where the stale PR is listed first: the old lookup picks it, the new one does not. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/e2e-report.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-report.yml b/.github/workflows/e2e-report.yml index 24aa7e79..8ce581c7 100644 --- a/.github/workflows/e2e-report.yml +++ b/.github/workflows/e2e-report.yml @@ -63,7 +63,13 @@ jobs: repo: context.repo.repo, commit_sha: run.head_sha, }); - prNumber = prs[0]?.number; + // One commit can be associated with several PRs, so match the one whose head is + // still this run's — `prs[0]` hands the report to whichever is listed first. + prNumber = prs.find((pr) => + pr.head?.sha === run.head_sha && + pr.head?.ref === run.head_branch && + pr.head?.repo?.full_name === run.head_repository?.full_name + )?.number; } if (!prNumber) { core.info(`No PR found for ${run.head_sha}; skipping comment.`);