force push

This commit is contained in:
Peter Evans 2024-08-08 17:16:40 +00:00
parent 2707da835d
commit 90b04fe25b
2 changed files with 3 additions and 2 deletions

2
dist/index.js vendored
View file

@ -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`);

View file

@ -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`)