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 <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-09-05 21:06:26 +00:00
parent 5df0e12e0f
commit 163fc40f7d
No known key found for this signature in database

View file

@ -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;