From b415404051d584f44a90feea02eb43f764d72955 Mon Sep 17 00:00:00 2001 From: peter-evans <18365890+peter-evans@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:46:57 +0000 Subject: [PATCH] build: update distribution --- dist/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0af2ad0513..4169be0d8b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1644,8 +1644,10 @@ class GitHubHelper { createOrUpdateRef(branchRepository, branch, newHead) { return __awaiter(this, void 0, void 0, function* () { const repository = this.parseRepository(branchRepository); - const branchExists = yield this.octokit.rest.repos - .getBranch(Object.assign(Object.assign({}, repository), { branch: branch })) + // Check the git ref directly rather than using the branches API, which + // follows branch rename redirects and can return a different branch. + const branchExists = yield this.octokit.rest.git + .getRef(Object.assign(Object.assign({}, repository), { ref: `heads/${branch}` })) .then(() => true, () => false); if (branchExists) { core.info(`Branch ${branch} exists; Updating ref`);