diff --git a/.github/actions/javascript/getPreviousVersion/getPreviousVersion.js b/.github/actions/javascript/getPreviousVersion/getPreviousVersion.js index 5a5447264851..aaff0d0a6027 100644 --- a/.github/actions/javascript/getPreviousVersion/getPreviousVersion.js +++ b/.github/actions/javascript/getPreviousVersion/getPreviousVersion.js @@ -3,10 +3,9 @@ const core = require('@actions/core'); const _ = require('underscore'); const versionUpdater = require('../../../libs/versionUpdater'); -let semverLevel = core.getInput('SEMVER_LEVEL', {require: true}); +const semverLevel = core.getInput('SEMVER_LEVEL', {require: true}); if (!semverLevel || !_.contains(versionUpdater.SEMANTIC_VERSION_LEVELS, semverLevel)) { - semverLevel = versionUpdater.SEMANTIC_VERSION_LEVELS.PATCH; - console.warn(`Invalid input for 'SEMVER_LEVEL': ${semverLevel}`, `Defaulting to: ${semverLevel}`); + core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`); } const {version: currentVersion} = JSON.parse(readFileSync('./package.json')); diff --git a/.github/actions/javascript/getPreviousVersion/index.js b/.github/actions/javascript/getPreviousVersion/index.js index 425132c50e34..5498aa3996d7 100644 --- a/.github/actions/javascript/getPreviousVersion/index.js +++ b/.github/actions/javascript/getPreviousVersion/index.js @@ -13,10 +13,9 @@ const core = __nccwpck_require__(186); const _ = __nccwpck_require__(571); const versionUpdater = __nccwpck_require__(7); -let semverLevel = core.getInput('SEMVER_LEVEL', {require: true}); +const semverLevel = core.getInput('SEMVER_LEVEL', {require: true}); if (!semverLevel || !_.contains(versionUpdater.SEMANTIC_VERSION_LEVELS, semverLevel)) { - semverLevel = versionUpdater.SEMANTIC_VERSION_LEVELS.PATCH; - console.warn(`Invalid input for 'SEMVER_LEVEL': ${semverLevel}`, `Defaulting to: ${semverLevel}`); + core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`); } const {version: currentVersion} = JSON.parse(readFileSync('./package.json'));