From 63aac9338fa4e48a023e91fb7051c62ec4c49404 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:16:40 +0000 Subject: [PATCH] force push --- dist/index.js | 2 +- src/github-helper.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6a0ff70..98db25f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1321,7 +1321,7 @@ class GitHubHelper { .then(() => true, () => false); if (branchExists) { core.info(`Branch ${branch} exists; Updating ref`); - yield this.octokit.rest.git.updateRef(Object.assign(Object.assign({}, repository), { sha: newHead, ref: `heads/${branch}` })); + yield this.octokit.rest.git.updateRef(Object.assign(Object.assign({}, repository), { sha: newHead, ref: `heads/${branch}`, force: true })); } else { core.info(`Branch ${branch} does not exist; Creating ref`); diff --git a/src/github-helper.ts b/src/github-helper.ts index 7632fc2..5cb17ed 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -278,7 +278,8 @@ export class GitHubHelper { await this.octokit.rest.git.updateRef({ ...repository, sha: newHead, - ref: `heads/${branch}` + ref: `heads/${branch}`, + force: true }) } else { core.info(`Branch ${branch} does not exist; Creating ref`)