Skip to content

Commit

Permalink
force push
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Aug 8, 2024
1 parent 7c05996 commit bf8dd09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
3 changes: 2 additions & 1 deletion src/github-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down

0 comments on commit bf8dd09

Please sign in to comment.