Skip to content

Commit

Permalink
fix: output current version if there is no new ver
Browse files Browse the repository at this point in the history
  • Loading branch information
cdotyab authored and cdotyab committed Nov 17, 2022
1 parent 22e862a commit b1e290f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async function run() {
}

let newVersion
let oldVersion

// If skipVersionFile or skipCommit is true we use GIT to determine the new version because
// skipVersionFile can mean there is no version file and skipCommit can mean that the user
Expand All @@ -114,6 +115,7 @@ async function run() {
)

newVersion = versioning.newVersion
oldVersion = versioning.oldVersion

} else {
const files = versionFile.split(',').map((f) => f.trim())
Expand All @@ -129,6 +131,7 @@ async function run() {
)

newVersion = versioning[0].newVersion
oldVersion = versioning[0].oldVersion
}

let gitTag = `${tagPrefix}${newVersion}`
Expand Down Expand Up @@ -157,6 +160,7 @@ async function run() {

if (skipEmptyRelease && cleanChangelog === '') {
core.info('Generated changelog is empty and skip-on-empty has been activated so we skip this step')
core.setOutput('version', oldVersion)
core.setOutput('skipped', 'true')
return
}
Expand Down Expand Up @@ -249,4 +253,4 @@ process.on('unhandledRejection', (reason, promise) => {
core.setFailed(error)
});

run()
run()

0 comments on commit b1e290f

Please sign in to comment.