From 498071a2ab617556ddf8089ebe2824ab63f77bfa Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Tue, 10 Nov 2026 12:41:25 +0100 Subject: [PATCH] ci: refresh lockfiles on an unchanged release PR Co-Authored-By: Claude Opus 5.5 --- scripts/release-on-push.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/release-on-push.ts b/scripts/release-on-push.ts index 21678e03..bfcdee6c 100644 --- a/scripts/release-on-push.ts +++ b/scripts/release-on-push.ts @@ -32,4 +32,13 @@ if (release) output('tag', release.tagName) const [pr] = (await (await manifest()).createPullRequests()).filter( (pr) => pr !== undefined, ) -if (pr) output('branch', pr.headBranchName) +// Release Please returns nothing when the open PR is already current, but its lockfiles may still need a commit. +const branch = pr?.headBranchName ?? (await openReleaseBranch(GITHUB_REF_NAME)) +if (branch) output('branch', branch) + +/** Find the branch of the open release PR, which Release Please labels as pending. */ +async function openReleaseBranch(target: string): Promise { + for await (const open of github.pullRequestIterator(target, 'OPEN')) { + if (open.labels.includes('autorelease: pending')) return open.headBranchName + } +}