Skip to content

Commit f81f840

Browse files
committed
feat: add force push option
1 parent 3409577 commit f81f840

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default class CommitManager {
143143
return
144144
}
145145
this.githubToken = getInput(this.options.githubTokenInputName, {required: true})
146-
await exec("git", ["push", `https://${process.env.GITHUB_ACTOR}:${this.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git`, `HEAD:${this.branch}`])
146+
await exec("git", ["push", ...this.options.forcePush ? ['-f'] : [], `https://${process.env.GITHUB_ACTOR}:${this.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git`, `HEAD:${this.branch}`])
147147
const octokit = new GitHub(this.githubToken)
148148
const pullCreateResult = await octokit.pulls.create({
149149
...context.repo,
@@ -189,4 +189,4 @@ export default class CommitManager {
189189
}
190190
}
191191

192-
}
192+
}

0 commit comments

Comments
 (0)