From 3ffccacd46053766916f087ce41d627c0b8cf2d1 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:50:36 +0000 Subject: [PATCH] build: update distribution (#4526) Co-authored-by: peter-evans <18365890+peter-evans@users.noreply.github.com> --- dist/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0af2ad05..4169be0d 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`);