From 024a58536447bd85ef77a5fda65faf583c095990 Mon Sep 17 00:00:00 2001 From: BetaHuhn Date: Thu, 18 Mar 2021 16:22:27 +0100 Subject: [PATCH] Fix remaining issues from #14 --- src/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 73f878d6..a6c318c5 100644 --- a/src/index.js +++ b/src/index.js @@ -40,11 +40,12 @@ const run = async () => { await git.setIdentity(client) await git.getBaseBranch() - if (!SKIP_PR) { + let existingPr + if (SKIP_PR === false) { await git.createPrBranch() // Check for existing PR and add warning message that the PR maybe about to change - const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined + existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined if (existingPr && DRY_RUN === false) { core.info(`Found existing PR ${ existingPr.number }`) await git.setPrWarning() @@ -122,10 +123,6 @@ const run = async () => { if (hasChanges === false && modified.length < 1) { core.info('File(s) already up to date') - if (SKIP_PR) { - return - } - if (existingPr) { await git.removePrWarning() } @@ -146,7 +143,7 @@ const run = async () => { core.info(`Pushing changes to target repository`) await git.push() - if (!SKIP_PR) { + if (SKIP_PR === false) { // If each file was committed separately, list them in the PR description const changedFiles = dedent(`
@@ -184,6 +181,7 @@ const run = async () => { }) } } + core.info(' ') } catch (err) { core.error(err.message)