diff --git a/action.yml b/action.yml index a72157d4..82d83b00 100644 --- a/action.yml +++ b/action.yml @@ -150,6 +150,11 @@ inputs: description: "The identifier to use for pre-releases" default: "rc" required: false + + skip-bump: + description: "Skips the version bump" + default: "false" + required: false outputs: changelog: diff --git a/dist/index.js b/dist/index.js index 3fa67bed..1223390c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34738,7 +34738,7 @@ const changelog = __nccwpck_require__(1749) const requireScript = __nccwpck_require__(4492) const { loadPreset, loadPresetConfig } = __nccwpck_require__(6921) -async function handleVersioningByExtension(ext, file, versionPath, releaseType) { +async function handleVersioningByExtension(ext, file, versionPath, releaseType, skipBump) { const versioning = getVersioning(ext) // File type isn't supported @@ -34749,7 +34749,9 @@ async function handleVersioningByExtension(ext, file, versionPath, releaseType) versioning.init(path.resolve(process.cwd(), file), versionPath) // Bump the version in the package.json - await versioning.bump(releaseType) + if(!skipBump){ + await versioning.bump(releaseType) + } return versioning } @@ -34781,6 +34783,7 @@ async function run() { const skipCi = core.getBooleanInput('skip-ci') const createSummary = core.getBooleanInput('create-summary') const prerelease = core.getBooleanInput('pre-release') + const skipBump = core.getBooleanInput('skip-bump') if (skipCi) { gitCommitMessage += ' [skip ci]' @@ -34812,6 +34815,10 @@ async function run() { core.info(`Using "${preChangelogGenerationFile}" as pre-changelog-generation script`) } + if(skipBump) { + core.info('Skipping bumping the version') + } + core.info(`Skipping empty releases is "${skipEmptyRelease ? 'enabled' : 'disabled'}"`) core.info(`Skipping the update of the version file is "${skipVersionFile ? 'enabled' : 'disabled'}"`) @@ -34850,11 +34857,12 @@ async function run() { 'git', versionFile, versionPath, - recommendation.releaseType + recommendation.releaseType, + skipBump ) - newVersion = versioning.newVersion oldVersion = versioning.oldVersion + newVersion = skipBump ? oldVersion : versioning.newVersion } else { const files = versionFile.split(',').map((f) => f.trim()) @@ -34865,12 +34873,12 @@ async function run() { const fileExtension = file.split('.').pop() core.info(`Bumping version to file "${file}" with extension "${fileExtension}"`) - return handleVersioningByExtension(fileExtension, file, versionPath, recommendation.releaseType) + return handleVersioningByExtension(fileExtension, file, versionPath, recommendation.releaseType, skipBump) }) ) - newVersion = versioning[0].newVersion oldVersion = versioning[0].oldVersion + newVersion = skipBump ? oldVersion : versioning[0].newVersion } let gitTag = `${tagPrefix}${newVersion}` diff --git a/package-lock.json b/package-lock.json index 04b55d9d..2e01e443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "conventional-changelog-action", - "version": "5.0.0", + "version": "5.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "conventional-changelog-action", - "version": "5.0.0", + "version": "5.1.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1",