From ae32d567b6902c5fd23868ef5717c1d5127fe06a Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Fri, 27 May 2022 16:03:30 +0200 Subject: [PATCH] fix: Use `getBooleanInput` for boolean values Fixes #161 --- src/helpers/git.js | 3 ++- src/index.js | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index 856e971..eee8a0d 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -175,8 +175,9 @@ module.exports = new (class Git { if (!SKIPPED_COMMIT) { expectedCommands.push('git add .') - if (SKIP_CI === false) { + if (SKIP_CI === 'false') { expectedCommands.push(`git commit -m "chore(release): ${EXPECTED_TAG}"`) + } else { expectedCommands.push(`git commit -m "chore(release): ${EXPECTED_TAG} [skip ci]"`) } diff --git a/src/index.js b/src/index.js index c23ad08..c0d9c9f 100644 --- a/src/index.js +++ b/src/index.js @@ -28,7 +28,7 @@ async function run() { let gitCommitMessage = core.getInput('git-message') const gitUserName = core.getInput('git-user-name') const gitUserEmail = core.getInput('git-user-email') - const gitPush = core.getInput('git-push').toLowerCase() === 'true' + const gitPush = core.getBooleanInput('git-push') const tagPrefix = core.getInput('tag-prefix') const preset = !core.getInput('config-file-path') ? core.getInput('preset') : '' const preCommitFile = core.getInput('pre-commit') @@ -36,14 +36,14 @@ async function run() { const releaseCount = core.getInput('release-count') const versionFile = core.getInput('version-file') const versionPath = core.getInput('version-path') - const skipGitPull = core.getInput('skip-git-pull').toLowerCase() === 'true' - const skipVersionFile = core.getInput('skip-version-file').toLowerCase() === 'true' - const skipCommit = core.getInput('skip-commit').toLowerCase() === 'true' - const skipEmptyRelease = core.getInput('skip-on-empty').toLowerCase() === 'true' + const skipGitPull = core.getBooleanInput('skip-git-pull') + const skipVersionFile = core.getBooleanInput('skip-version-file') + const skipCommit = core.getBooleanInput('skip-commit') + const skipEmptyRelease = core.getBooleanInput('skip-on-empty') const conventionalConfigFile = core.getInput('config-file-path') const preChangelogGenerationFile = core.getInput('pre-changelog-generation') const gitUrl = core.getInput('git-url') - const skipCi = core.getInput('skip-ci') + const skipCi = core.getBooleanInput('skip-ci') if (skipCi) { gitCommitMessage += " [skip ci]"