From c59800fe8dfc425a3f502f7f464fbd35c3afe9fc Mon Sep 17 00:00:00 2001 From: sauloxd Date: Wed, 2 Sep 2020 18:40:07 -0300 Subject: [PATCH] Only return to branch on non closed events --- packages/action/dist/index.js | 6 +++--- packages/action/src/create-review-app.js | 3 --- packages/action/src/other-events.js | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/action/dist/index.js b/packages/action/dist/index.js index c30f8eb..8ad6903 100644 --- a/packages/action/dist/index.js +++ b/packages/action/dist/index.js @@ -10125,9 +10125,6 @@ async function createReviewApp() { }); } - core.debug('Return to original state'); - await exec('git', ['fetch', 'origin', branchName]); - await exec('git', ['checkout', branchName]); } @@ -10294,6 +10291,9 @@ async function otherEvents({ await exec('git', ['push', 'origin', ghBranch]); }); await io.rmRF('.tmp'); + core.debug('Return to original state'); + await exec('git', ['fetch', 'origin', branchName]); + await exec('git', ['checkout', branchName]); } diff --git a/packages/action/src/create-review-app.js b/packages/action/src/create-review-app.js index e5d128a..7ac2b8b 100644 --- a/packages/action/src/create-review-app.js +++ b/packages/action/src/create-review-app.js @@ -57,7 +57,4 @@ async function createReviewApp() { }); } - core.debug('Return to original state'); - await exec('git', ['fetch', 'origin', branchName]); - await exec('git', ['checkout', branchName]); } diff --git a/packages/action/src/other-events.js b/packages/action/src/other-events.js index 6dc67a3..9247f66 100644 --- a/packages/action/src/other-events.js +++ b/packages/action/src/other-events.js @@ -89,4 +89,7 @@ async function otherEvents({ await exec('git', ['push', 'origin', ghBranch]); }); await io.rmRF('.tmp'); + core.debug('Return to original state'); + await exec('git', ['fetch', 'origin', branchName]); + await exec('git', ['checkout', branchName]); }