Skip to content

Commit

Permalink
Fix remaining issues from #14
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Mar 18, 2021
1 parent 5ac0399 commit 024a585
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
}
Expand All @@ -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(`
<details>
Expand Down Expand Up @@ -184,6 +181,7 @@ const run = async () => {
})
}
}

core.info(' ')
} catch (err) {
core.error(err.message)
Expand Down

0 comments on commit 024a585

Please sign in to comment.