diff --git a/src/config.js b/src/config.js index 9804ff9d..ef751441 100644 --- a/src/config.js +++ b/src/config.js @@ -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 diff --git a/src/index.js b/src/index.js index 073a61c7..fcb65ecb 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,9 @@ const { COMMIT_PREFIX, PR_LABELS, ASSIGNEES, - DRY_RUN + DRY_RUN, + TMP_DIR, + SKIP_CLEANUP } = require('./config') const run = async () => { @@ -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) }) \ No newline at end of file