Use force-with-lease to push the pr branch

This commit is contained in:
Peter Evans 2020-07-17 10:37:09 +09:00
parent 5429e57002
commit a6a1a418bf
3 changed files with 100 additions and 20 deletions

View file

@ -185,7 +185,11 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
core.startGroup(
`Pushing pull request branch to 'origin/${inputs.branch}'`
)
await git.push(['--force', 'origin', `HEAD:refs/heads/${inputs.branch}`])
await git.push([
'--force-with-lease',
'origin',
`HEAD:refs/heads/${inputs.branch}`
])
core.endGroup()
// Set the base. It would have been '' if not specified as an input