Skip to content

Commit

Permalink
add parameter to action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfrenken committed Feb 5, 2024
1 parent e8ceb26 commit df0cb39
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 14 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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]'
Expand Down Expand Up @@ -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'}"`)

Expand Down Expand Up @@ -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())
Expand All @@ -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}`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit df0cb39

Please sign in to comment.