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

6
dist/index.js vendored
View file

@ -10604,7 +10604,11 @@ function createPullRequest(inputs) {
if (['created', 'updated'].includes(result.action)) {
// The branch was created or updated
core.startGroup(`Pushing pull request branch to 'origin/${inputs.branch}'`);
yield git.push(['--force', 'origin', `HEAD:refs/heads/${inputs.branch}`]);
yield 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
inputs.base = result.base;