From 0600ca1902042ed6a922d78a40b180eadc546142 Mon Sep 17 00:00:00 2001 From: Dmitry Gusakov Date: Tue, 30 Aug 2022 18:58:49 +0300 Subject: [PATCH] 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')