From 163fc40f7dcec65f2d7ce82be3aab1edd8349545 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 5 Sep 2026 21:06:26 +0000 Subject: [PATCH] fix(ci): ignore fork base PRs in release wheel reporter The reporter for LiteLLM Rust runs on the workflow_run event and requires exactly one associated pull request. When a fork opens a PR targeting its own copy of `litellm_internal_staging` with a head SHA that matches the upstream repo, GitHub includes that fork PR in `workflow_run.pull_requests` alongside the real internal PR, so the strict `length !== 1` guard throws "unexpected source workflow" and the reporter fails on every internal staging push. Filter `pull_requests` to entries whose base repo id matches the workflow repo id before applying the exact-one check, so cross-repo PR entries are ignored and the reporter still targets the correct internal PR. Co-authored-by: Krrish Dholakia --- .github/workflows/report-rust-release-wheel.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/report-rust-release-wheel.yml b/.github/workflows/report-rust-release-wheel.yml index 74e6be69604..70f16a4d5f2 100644 --- a/.github/workflows/report-rust-release-wheel.yml +++ b/.github/workflows/report-rust-release-wheel.yml @@ -46,17 +46,20 @@ jobs: "success", "timed_out", ]); + const expectedRepoFullName = `${context.repo.owner}/${context.repo.repo}`; + const internalPullRequests = (workflowRun.pull_requests || []).filter( + (pr) => pr?.base?.repo?.id === workflowRun.repository?.id, + ); if ( !allowedConclusions.has(workflowRun.conclusion) || workflowRun.event !== "pull_request" || workflowRun.path !== ".github/workflows/test-rust.yml" || - workflowRun.head_repository?.full_name !== - `${context.repo.owner}/${context.repo.repo}` || - workflowRun.pull_requests?.length !== 1 + workflowRun.head_repository?.full_name !== expectedRepoFullName || + internalPullRequests.length !== 1 ) { throw new Error("unexpected source workflow"); } - const pullRequest = workflowRun.pull_requests[0]; + const pullRequest = internalPullRequests[0]; const pullRequestNumber = pullRequest.number; const headSha = workflowRun.head_sha; const runId = workflowRun.id;