build: update distribution (#4526)

Co-authored-by: peter-evans <18365890+peter-evans@users.noreply.github.com>
This commit is contained in:
actions-botandpeter-evans authored and GitHub committed 2026-11-10 12:50:36 +00:00
1 parent 77d56500d9
commit 3ffccacd46
1 file changed
+4 -2
+4 -2
View File
@@ -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`);