Skip to content

Commit

Permalink
✨Cleanup tmp directories
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Jan 10, 2021
1 parent b7e5310 commit 35e1508
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ const context = {
type: 'boolean',
default: false
}),
SKIP_CLEANUP: getVar({
key: 'SKIP_CLEANUP',
type: 'boolean',
default: false
}),
GITHUB_REPOSITORY: getVar({
key: 'GITHUB_REPOSITORY',
required: true
Expand Down
14 changes: 11 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const {
COMMIT_PREFIX,
PR_LABELS,
ASSIGNEES,
DRY_RUN
DRY_RUN,
TMP_DIR,
SKIP_CLEANUP
} = require('./config')

const run = async () => {
Expand Down Expand Up @@ -199,12 +201,18 @@ const run = async () => {
}
})

core.info('DONE')
if (SKIP_CLEANUP === true) {
core.info('Skipping cleanup')
return
}

await io.rmRF(TMP_DIR)
core.info('Cleanup complete')
}

run()
.then(() => {})
.catch((err) => {
console.error('ERROR', err)
core.error('ERROR', err)
core.setFailed(err.message)
})

0 comments on commit 35e1508

Please sign in to comment.