From 0600ca1902042ed6a922d78a40b180eadc546142 Mon Sep 17 00:00:00 2001 From: Dmitry Gusakov Date: Tue, 30 Aug 2022 18:58:49 +0300 Subject: [PATCH 1/2] fix: Add global unhandledRejection handler --- src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.js b/src/index.js index 8fae0868..cd347b9e 100644 --- a/src/index.js +++ b/src/index.js @@ -25,6 +25,13 @@ async function handleVersioningByExtension(ext, file, versionPath, releaseType) async function run() { try { + + process.on('unhandledRejection', (reason, promise) => { + let error = `Unhandled Rejection occurred. Reason: ${reason.stack}` + console.error(error) + core.setFailed(error) + }); + let gitCommitMessage = core.getInput('git-message') const gitUserName = core.getInput('git-user-name') const gitUserEmail = core.getInput('git-user-email') From 4e5fd06e0ece4b08567d9cb752688b6256331991 Mon Sep 17 00:00:00 2001 From: Dmitry Gusakov Date: Tue, 30 Aug 2022 21:10:51 +0300 Subject: [PATCH 2/2] chore: Fix remarks --- src/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index cd347b9e..2a435b40 100644 --- a/src/index.js +++ b/src/index.js @@ -25,13 +25,6 @@ async function handleVersioningByExtension(ext, file, versionPath, releaseType) async function run() { try { - - process.on('unhandledRejection', (reason, promise) => { - let error = `Unhandled Rejection occurred. Reason: ${reason.stack}` - console.error(error) - core.setFailed(error) - }); - let gitCommitMessage = core.getInput('git-message') const gitUserName = core.getInput('git-user-name') const gitUserEmail = core.getInput('git-user-email') @@ -243,4 +236,10 @@ async function run() { } } +process.on('unhandledRejection', (reason, promise) => { + let error = `Unhandled Rejection occurred. ${reason.stack}` + console.error(error) + core.setFailed(error) +}); + run()