Use force-with-lease to push the pr branch
This commit is contained in:
parent
5429e57002
commit
a6a1a418bf
|
@ -194,7 +194,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -223,7 +227,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -255,7 +263,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -285,7 +297,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -329,7 +345,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -358,7 +378,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -398,7 +422,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -437,7 +465,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -480,7 +512,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -536,7 +572,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -576,7 +616,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -619,7 +663,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -660,7 +708,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -715,7 +767,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -757,7 +813,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -808,7 +868,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -858,7 +922,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
@ -912,7 +980,11 @@ describe('create-or-update-branch tests', () => {
|
||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
|
|
||||||
// Push pull request branch to remote
|
// Push pull request branch to remote
|
||||||
await git.push(['--force', 'origin', `HEAD:refs/heads/${BRANCH}`])
|
await git.push([
|
||||||
|
'--force-with-lease',
|
||||||
|
'origin',
|
||||||
|
`HEAD:refs/heads/${BRANCH}`
|
||||||
|
])
|
||||||
|
|
||||||
await afterTest(false)
|
await afterTest(false)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
|
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -10604,7 +10604,11 @@ function createPullRequest(inputs) {
|
||||||
if (['created', 'updated'].includes(result.action)) {
|
if (['created', 'updated'].includes(result.action)) {
|
||||||
// The branch was created or updated
|
// The branch was created or updated
|
||||||
core.startGroup(`Pushing pull request branch to 'origin/${inputs.branch}'`);
|
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();
|
core.endGroup();
|
||||||
// Set the base. It would have been '' if not specified as an input
|
// Set the base. It would have been '' if not specified as an input
|
||||||
inputs.base = result.base;
|
inputs.base = result.base;
|
||||||
|
|
|
@ -185,7 +185,11 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
||||||
core.startGroup(
|
core.startGroup(
|
||||||
`Pushing pull request branch to 'origin/${inputs.branch}'`
|
`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()
|
core.endGroup()
|
||||||
|
|
||||||
// Set the base. It would have been '' if not specified as an input
|
// Set the base. It would have been '' if not specified as an input
|
||||||
|
|
Loading…
Reference in a new issue