Skip to content

Commit

Permalink
fix: changes exit codes to not to break Github actions (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanto authored Nov 24, 2022
1 parent 889da2a commit 64c58a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function runYaba() {
}

// release completed, to prevent hanging forcing to exit
process.exit(1);
process.exit(0);

} catch (error) {
console.log(error);
Expand Down Expand Up @@ -86,7 +86,7 @@ async function checkHeadBranch(repoOwner, releaseRepo) {
const headBranch = await flow.fetchHeadBranch(repoOwner, releaseRepo);
if (headBranch == null) {
console.log(kleur.red("Head branch can not be found! The release has been interrupted!"));
process.exit();
process.exit(0);
}
return headBranch;
}
Expand All @@ -95,7 +95,7 @@ function checkDirectory() {
// check if the current directory is git repo
if (options.repo == undefined && !helper.isGitRepo()) {
console.log(`The directory '${helper.retrieveCurrentDirectory()}' is not a Git repo.`);
process.exit();
process.exit(0);
}
}

Expand Down
10 changes: 5 additions & 5 deletions bin/utils/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
spinner.start('Checking required ENV variables...');
if (helper.requiredEnvVariablesExist() == false) {
spinner.fail('The required env variables are not set in order to run the command.');
process.exit();
process.exit(0);
}
spinner.succeed('Required ENV variables in place.');
},
Expand All @@ -37,7 +37,7 @@ module.exports = {
const isInternetUp = await isOnline();
if (!isInternetUp) {
spinner.fail('There is no internet connection!');
process.exit();
process.exit(0);
}
spinner.succeed('Internet connection established.');
},
Expand Down Expand Up @@ -135,7 +135,7 @@ module.exports = {
} catch(error) {
const errorResponseData = error.response.data;
spinner.fail(`Something went wrong while preparing the changelog! ${errorResponseData.message} -> ${errorResponseData.documentation_url}`);
process.exit();
process.exit(0);
}
},

Expand Down Expand Up @@ -199,7 +199,7 @@ module.exports = {
errorMessage += `\t* field: '${element.field}' - code: '${element.code}'`;
});
spinner.fail(`${message} while preparing the release! ${errorMessage}`);
process.exit();
process.exit(0);
}
},

Expand Down Expand Up @@ -256,7 +256,7 @@ async function postToSlack(channelUrl, message) {
})
.catch(error => {
spinner.fail(`Something went wrong while sending to Slack channel: ${error}`);
process.exit();
process.exit(0);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yaba-release-cli",
"version": "1.7.4",
"version": "1.7.5",
"description": "Yaba is a simple CLI tool that helps you manage releases of your Github projects.",
"main": "bin/index.js",
"scripts": {
Expand Down

0 comments on commit 64c58a2

Please sign in to comment.