From e56a8dc0ce4942508d4c09000f09690553565416 Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:44:50 +0200 Subject: [PATCH 01/10] fix: Git tags empty --- src/helpers/git.js | 2 +- src/version/git.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index de5c185..930a0c2 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -97,7 +97,7 @@ module.exports = new (class Git { * @return {Promise<>} */ pull = () => ( - this.exec(`pull --unshallow ${core.getInput('git-pull-method')}`) + this.exec(`pull ${core.getInput('git-pull-method')}`) ) /** diff --git a/src/version/git.js b/src/version/git.js index b73cc38..0a0743c 100644 --- a/src/version/git.js +++ b/src/version/git.js @@ -13,7 +13,7 @@ module.exports = new (class Git extends BaseVersioning { gitSemverTags({ tagPrefix, }, (err, tags) => { - const currentVersion = tags.shift().replace(tagPrefix, '') + const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : '0.1.0' // Get the new version this.newVersion = bumpVersion( From c9d402453191a8c3684e7f1c94a07752d402aa4a Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Sun, 9 Aug 2020 12:24:24 +0200 Subject: [PATCH 02/10] revert: "fix: Git tags empty" This reverts commit e56a8dc0ce4942508d4c09000f09690553565416. --- src/helpers/git.js | 2 +- src/version/git.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index 930a0c2..de5c185 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -97,7 +97,7 @@ module.exports = new (class Git { * @return {Promise<>} */ pull = () => ( - this.exec(`pull ${core.getInput('git-pull-method')}`) + this.exec(`pull --unshallow ${core.getInput('git-pull-method')}`) ) /** diff --git a/src/version/git.js b/src/version/git.js index 0a0743c..b73cc38 100644 --- a/src/version/git.js +++ b/src/version/git.js @@ -13,7 +13,7 @@ module.exports = new (class Git extends BaseVersioning { gitSemverTags({ tagPrefix, }, (err, tags) => { - const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : '0.1.0' + const currentVersion = tags.shift().replace(tagPrefix, '') // Get the new version this.newVersion = bumpVersion( From 3396dfc4323e48de090308fff522ef4c557f73e5 Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Sun, 9 Aug 2020 12:28:05 +0200 Subject: [PATCH 03/10] fix: Pull all tags --- src/helpers/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index de5c185..05b5bf1 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -97,7 +97,7 @@ module.exports = new (class Git { * @return {Promise<>} */ pull = () => ( - this.exec(`pull --unshallow ${core.getInput('git-pull-method')}`) + this.exec(`pull --unshallow --tags ${core.getInput('git-pull-method')}`) ) /** From 63d0e46a0b69e3db3f7a5f44e963323afc35d29c Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Sun, 9 Aug 2020 12:37:03 +0200 Subject: [PATCH 04/10] feat: Add fallback version --- .github/workflows/test.yml | 140 +++++++++++++++++++++++++++++++++++++ README.md | 9 ++- action.yml | 5 ++ package-lock.json | 10 +-- package.json | 2 +- src/helpers/bumpVersion.js | 46 ++++++++---- src/version/base.js | 4 +- src/version/git.js | 2 +- src/version/json.js | 9 ++- src/version/toml.js | 31 +++++--- src/version/yaml.js | 29 +++++--- test/test-file-empty.json | 0 test/test-file-empty.toml | 0 test/test-file-empty.yaml | 0 14 files changed, 243 insertions(+), 44 deletions(-) create mode 100644 test/test-file-empty.json create mode 100644 test/test-file-empty.toml create mode 100644 test/test-file-empty.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aec3180..0d59bde 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,47 @@ jobs: with: github-token: ${{ secrets.github_token }} + test-json-new: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: "./" + + - name: Generate changelog + id: changelog + uses: ./ + env: + ENV: 'dont-use-git' + with: + github-token: ${{ secrets.github_token }} + version-file: 'test-file-new.json' + + - name: Show file + id: show + run: | + echo "$( { - let [major, minor, patch] = version.split('.') + let major, minor, patch - switch (releaseType) { - case 'major': - major = parseInt(major, 10) + 1 - minor = 0 + if (version) { + [major, minor, patch] = version.split('.') + + switch (releaseType) { + case 'major': + major = parseInt(major, 10) + 1 + minor = 0 + patch = 0 + break + + case 'minor': + minor = parseInt(minor, 10) + 1 + patch = 0 + break + + default: + patch = parseInt(patch, 10) + 1 + } + } else { + let version = semverValid(core.getInput('fallback-version')) + + if (version) { + [major, minor, patch] = version.split('.') + } else { + // default + major = 0 + minor = 1 patch = 0 - break - - case 'minor': - minor = parseInt(minor, 10) + 1 - patch = 0 - break - - default: - patch = parseInt(patch, 10) + 1 + } } return `${major}.${minor}.${patch}` diff --git a/src/version/base.js b/src/version/base.js index 04a172d..9089e29 100644 --- a/src/version/base.js +++ b/src/version/base.js @@ -25,7 +25,9 @@ module.exports = class BaseVersioning { * @return {string} */ read = () => { - return fs.readFileSync(this.fileLocation, 'utf8') + if (fs.existsSync(this.fileLocation)) { + return fs.readFileSync(this.fileLocation, 'utf8') + } } /** diff --git a/src/version/git.js b/src/version/git.js index b73cc38..4077c93 100644 --- a/src/version/git.js +++ b/src/version/git.js @@ -13,7 +13,7 @@ module.exports = new (class Git extends BaseVersioning { gitSemverTags({ tagPrefix, }, (err, tags) => { - const currentVersion = tags.shift().replace(tagPrefix, '') + const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : null // Get the new version this.newVersion = bumpVersion( diff --git a/src/version/json.js b/src/version/json.js index 150e9a3..662101f 100644 --- a/src/version/json.js +++ b/src/version/json.js @@ -12,10 +12,15 @@ module.exports = new (class Json extends BaseVersioning { * @return {*} */ bump = (releaseType) => { + let jsonContent = {} + let oldVersion + // Read the file const fileContent = this.read() - const jsonContent = JSON.parse(fileContent) - const oldVersion = objectPath.get(jsonContent, this.versionPath) + if (fileContent) { + jsonContent = JSON.parse(fileContent) + oldVersion = objectPath.get(jsonContent, this.versionPath) + } // Get the new version this.newVersion = bumpVersion( diff --git a/src/version/toml.js b/src/version/toml.js index e164e38..734ff8e 100644 --- a/src/version/toml.js +++ b/src/version/toml.js @@ -1,5 +1,5 @@ const objectPath = require('object-path') -const toml = require('toml') +const toml = require('@iarna/toml') const BaseVersioning = require('./base') const bumpVersion = require('../helpers/bumpVersion') @@ -13,10 +13,15 @@ module.exports = new (class Toml extends BaseVersioning{ * @return {*} */ bump = (releaseType) => { + let tomlContent = {} + let oldVersion + // Read the file const fileContent = this.read() - const tomlContent = toml.parse(fileContent) - const oldVersion = objectPath.get(tomlContent, this.versionPath) + if (fileContent) { + tomlContent = toml.parse(fileContent) + oldVersion = objectPath.get(tomlContent, this.versionPath) + } // Get the new version this.newVersion = bumpVersion( @@ -28,13 +33,19 @@ module.exports = new (class Toml extends BaseVersioning{ const versionName = this.versionPath.split('.').pop() // Update the file - this.update( - // We use replace so we can preserve white spaces and comments - fileContent.replace( - `${versionName} = "${oldVersion}"`, - `${versionName} = "${this.newVersion}"`, - ), - ) + if (fileContent) { + this.update( + // We use replace instead of yaml.stringify so we can preserve white spaces and comments + fileContent.replace( + `${versionName} = "${oldVersion}"`, + `${versionName} = "${this.newVersion}"`, + ), + ) + } else { + // Update the content with the new version + objectPath.set(tomlContent, this.versionPath, this.newVersion) + this.update(toml.stringify(tomlContent)) + } } }) diff --git a/src/version/yaml.js b/src/version/yaml.js index da7db77..133d9c1 100644 --- a/src/version/yaml.js +++ b/src/version/yaml.js @@ -13,10 +13,15 @@ module.exports = new (class Yaml extends BaseVersioning{ * @return {*} */ bump = (releaseType) => { + let yamlContent = {} + let oldVersion + // Read the file const fileContent = this.read() - const yamlContent = yaml.parse(fileContent) - const oldVersion = objectPath.get(yamlContent, this.versionPath) + if (fileContent) { + yamlContent = yaml.parse(fileContent) + oldVersion = objectPath.get(yamlContent, this.versionPath) + } // Get the new version this.newVersion = bumpVersion( @@ -28,13 +33,19 @@ module.exports = new (class Yaml extends BaseVersioning{ const versionName = this.versionPath.split('.').pop() // Update the file - this.update( - // We use replace instead of yaml.stringify so we can preserve white spaces and comments - fileContent.replace( - `${versionName}: '${oldVersion}'`, - `${versionName}: '${this.newVersion}'`, - ), - ) + if (fileContent) { + this.update( + // We use replace instead of yaml.stringify so we can preserve white spaces and comments + fileContent.replace( + `${versionName}: '${oldVersion}'`, + `${versionName}: '${this.newVersion}'`, + ), + ) + } else { + // Update the content with the new version + objectPath.set(yamlContent, this.versionPath, this.newVersion) + this.update(yaml.stringify(yamlContent)) + } } }) diff --git a/test/test-file-empty.json b/test/test-file-empty.json new file mode 100644 index 0000000..e69de29 diff --git a/test/test-file-empty.toml b/test/test-file-empty.toml new file mode 100644 index 0000000..e69de29 diff --git a/test/test-file-empty.yaml b/test/test-file-empty.yaml new file mode 100644 index 0000000..e69de29 From 091fdfc6a55a151e3adff5ada382986ead85d58e Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:11:18 +0200 Subject: [PATCH 05/10] fix: Empty version files --- src/version/base.js | 4 +--- src/version/json.js | 9 ++------- src/version/toml.js | 17 ++++++----------- src/version/yaml.js | 17 ++++++----------- 4 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/version/base.js b/src/version/base.js index 9089e29..c9e142a 100644 --- a/src/version/base.js +++ b/src/version/base.js @@ -25,9 +25,7 @@ module.exports = class BaseVersioning { * @return {string} */ read = () => { - if (fs.existsSync(this.fileLocation)) { - return fs.readFileSync(this.fileLocation, 'utf8') - } + return fs.existsSync(this.fileLocation) ? fs.readFileSync(this.fileLocation, 'utf8') : '' } /** diff --git a/src/version/json.js b/src/version/json.js index 662101f..8125079 100644 --- a/src/version/json.js +++ b/src/version/json.js @@ -12,15 +12,10 @@ module.exports = new (class Json extends BaseVersioning { * @return {*} */ bump = (releaseType) => { - let jsonContent = {} - let oldVersion - // Read the file const fileContent = this.read() - if (fileContent) { - jsonContent = JSON.parse(fileContent) - oldVersion = objectPath.get(jsonContent, this.versionPath) - } + const jsonContent = JSON.parse(fileContent) + const oldVersion = objectPath.get(jsonContent, this.versionPath, null) // Get the new version this.newVersion = bumpVersion( diff --git a/src/version/toml.js b/src/version/toml.js index 734ff8e..ff889ee 100644 --- a/src/version/toml.js +++ b/src/version/toml.js @@ -13,15 +13,10 @@ module.exports = new (class Toml extends BaseVersioning{ * @return {*} */ bump = (releaseType) => { - let tomlContent = {} - let oldVersion - // Read the file const fileContent = this.read() - if (fileContent) { - tomlContent = toml.parse(fileContent) - oldVersion = objectPath.get(tomlContent, this.versionPath) - } + const tomlContent = toml.parse(fileContent) + const oldVersion = objectPath.get(tomlContent, this.versionPath, null) // Get the new version this.newVersion = bumpVersion( @@ -29,11 +24,11 @@ module.exports = new (class Toml extends BaseVersioning{ oldVersion, ) - // Get the name of where the version is in - const versionName = this.versionPath.split('.').pop() - // Update the file - if (fileContent) { + if (oldVersion) { + // Get the name of where the version is in + const versionName = this.versionPath.split('.').pop() + this.update( // We use replace instead of yaml.stringify so we can preserve white spaces and comments fileContent.replace( diff --git a/src/version/yaml.js b/src/version/yaml.js index 133d9c1..c29b9b2 100644 --- a/src/version/yaml.js +++ b/src/version/yaml.js @@ -13,15 +13,10 @@ module.exports = new (class Yaml extends BaseVersioning{ * @return {*} */ bump = (releaseType) => { - let yamlContent = {} - let oldVersion - // Read the file const fileContent = this.read() - if (fileContent) { - yamlContent = yaml.parse(fileContent) - oldVersion = objectPath.get(yamlContent, this.versionPath) - } + const yamlContent = yaml.parse(fileContent) || {} + const oldVersion = objectPath.get(yamlContent, this.versionPath, null) // Get the new version this.newVersion = bumpVersion( @@ -29,11 +24,11 @@ module.exports = new (class Yaml extends BaseVersioning{ oldVersion, ) - // Get the name of where the version is in - const versionName = this.versionPath.split('.').pop() - // Update the file - if (fileContent) { + if (oldVersion) { + // Get the name of where the version is in + const versionName = this.versionPath.split('.').pop() + this.update( // We use replace instead of yaml.stringify so we can preserve white spaces and comments fileContent.replace( From e6c2b51e1fddf40a0418a33c7c44dbf60998aaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Mata=20Su=C3=A1rez?= Date: Mon, 10 Aug 2020 13:01:31 -0300 Subject: [PATCH 06/10] Changed 'skip-on-empty' default in README --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a953106..d8cacc6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `release-count`: Number of releases to preserve in changelog. Default `5`, use `0` to regenerate all. - **Optional** `version-file`: The path to the file that contains the version to bump. Default `./package.json`. - **Optional** `version-path`: The place inside the version file to bump. Default `version`. -- **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occured when you push `chore` commit with `angular` for example. Default `'false'`. +- **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occured when you push `chore` commit with `angular` for example. Default `'true'`. - **Optional** `skip-version-file`: Do not update the version file. Default `'false'`. - **Optional** `skip-commit`: Do create a release commit. Default `'false'`. - **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default. @@ -29,6 +29,7 @@ This action will bump version, tag commit and generate a changelog with conventi Specified path could be relative or absolute. If it is relative, then it will be based on the `GITHUB_WORKSPACE` path. Script should: + - be a CommonJS module - have a single export: `exports.preCommit = (props) => { /* ... */ }` - not have any return value @@ -96,7 +97,7 @@ No file changelog uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - output-file: 'false' + output-file: "false" ``` Tag only @@ -106,7 +107,7 @@ Tag only uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - skip-commit: 'true' + skip-commit: "true" ``` Use a custom file for versioning @@ -116,7 +117,7 @@ Use a custom file for versioning uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - version-file: 'my-custom-file.yaml' + version-file: "my-custom-file.yaml" ``` Use a pre-commit hook @@ -137,24 +138,26 @@ Github releases uses: TriPSs/conventional-changelog-action@v3 with: github-token: ${{ secrets.github_token }} - output-file: 'false' - skip-on-empty: 'true' + output-file: "false" - name: Create Release uses: actions/create-release@v1 if: ${{ steps.changelog.outputs.skipped == 'false' }} env: - GITHUB_TOKEN: ${{ secrets.github_token }} + GITHUB_TOKEN: ${{ secrets.github_token }} with: - tag_name: ${{ steps.changelog.outputs.tag }} - release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} ``` ## Development + If you'd like to contribute to this project, all you need to do is clone and install [act](https://github.com/nektos/act) this project and run: + > Make sure that `main: 'src/index.js'` is updated to `main: '../src/index.js'` inside the `action.yml` > Note: The image used is 18 gb! + ```shell $ yarn install From 283100b0c8b51e728cf3c1553169172ae432b703 Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Tue, 11 Aug 2020 15:08:10 +0200 Subject: [PATCH 07/10] build: Add semver dependency --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 4d20769..3818fb8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "conventional-recommended-bump": "6.0.9", "git-semver-tags": "4.0.0", "object-path": "^0.11.4", + "semver": "^6.0.0", "yaml": "^1.10.0" }, "devDependencies": { From 9a324dbd51d0d32c1b9df1a291e14cc20a5bbaff Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Tue, 11 Aug 2020 20:02:59 +0200 Subject: [PATCH 08/10] fix: Show info if the version couldn't be detected --- README.md | 2 +- action.yml | 2 +- src/helpers/bumpVersion.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b45ad05..e29fd75 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `skip-version-file`: Do not update the version file. Default `'false'`. - **Optional** `skip-commit`: Do create a release commit. Default `'false'`. - **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default. -- **Optional** `fallback-version`: The fallback version, if none is recognized. Default `'0.1.0'` +- **Optional** `fallback-version`: The fallback version, if no older one can be detected, or if it is the first one. Default `'0.1.0'` ### Pre-Commit hook diff --git a/action.yml b/action.yml index 57143ef..fc44ad1 100644 --- a/action.yml +++ b/action.yml @@ -84,7 +84,7 @@ inputs: required: false fallback-version: - description: 'The fallback version, if none is recognized' + description: 'The fallback version, if no older one can be detected, or if it is the first one' default: '0.1.0' required: false diff --git a/src/helpers/bumpVersion.js b/src/helpers/bumpVersion.js index f3db399..f81410a 100644 --- a/src/helpers/bumpVersion.js +++ b/src/helpers/bumpVersion.js @@ -42,5 +42,7 @@ module.exports = (releaseType, version) => { } } + core.info(`The version could not be detected, the new version is '${major}.${minor}.${patch}'.`) + return `${major}.${minor}.${patch}` } From 97f1bb3543e6f2480ef3e699fc695ecb8b3f881b Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Tue, 11 Aug 2020 20:30:55 +0200 Subject: [PATCH 09/10] fix: Use fallback if it's not a valid JSON-File --- .github/workflows/test.yml | 6 ++++++ src/version/json.js | 17 ++++++++++++++++- test/test-file-empty.json | 0 test/test-file-empty.toml | 0 test/test-file-empty.yaml | 0 5 files changed, 22 insertions(+), 1 deletion(-) delete mode 100644 test/test-file-empty.json delete mode 100644 test/test-file-empty.toml delete mode 100644 test/test-file-empty.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d59bde..8a088c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,6 +51,8 @@ jobs: with: path: "./" + - run: touch ./test-file-empty.json + - name: Generate changelog id: changelog uses: ./ @@ -147,6 +149,8 @@ jobs: with: path: "./" + - run: touch ./test-file-empty.yaml + - name: Generate changelog id: changelog uses: ./ @@ -225,6 +229,8 @@ jobs: with: path: "./" + - run: touch ./test-file-empty.toml + - name: Generate changelog id: changelog uses: ./ diff --git a/src/version/json.js b/src/version/json.js index 8125079..7a75c52 100644 --- a/src/version/json.js +++ b/src/version/json.js @@ -1,3 +1,4 @@ +const core = require('@actions/core') const objectPath = require('object-path') const BaseVersioning = require('./base') @@ -14,7 +15,21 @@ module.exports = new (class Json extends BaseVersioning { bump = (releaseType) => { // Read the file const fileContent = this.read() - const jsonContent = JSON.parse(fileContent) + + // Parse the file + let jsonContent + try { + jsonContent = JSON.parse(fileContent) + } catch (error) { + core.startGroup(`Error when parsing the file '${this.fileLocation}'`) + core.info(`File-Content: ${fileContent}`) + core.info(error) // should be 'warning' ? + core.endGroup() + + jsonContent = {} + } + + // Get the old version const oldVersion = objectPath.get(jsonContent, this.versionPath, null) // Get the new version diff --git a/test/test-file-empty.json b/test/test-file-empty.json deleted file mode 100644 index e69de29..0000000 diff --git a/test/test-file-empty.toml b/test/test-file-empty.toml deleted file mode 100644 index e69de29..0000000 diff --git a/test/test-file-empty.yaml b/test/test-file-empty.yaml deleted file mode 100644 index e69de29..0000000 From b525f9ae66cb03aa2a58cd043963504b911bac31 Mon Sep 17 00:00:00 2001 From: Jayrgo <13069032+Jayrgo@users.noreply.github.com> Date: Wed, 12 Aug 2020 17:27:06 +0200 Subject: [PATCH 10/10] fix: Message when using the fallback version --- src/helpers/bumpVersion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/bumpVersion.js b/src/helpers/bumpVersion.js index f81410a..b7a5882 100644 --- a/src/helpers/bumpVersion.js +++ b/src/helpers/bumpVersion.js @@ -40,9 +40,9 @@ module.exports = (releaseType, version) => { minor = 1 patch = 0 } - } - core.info(`The version could not be detected, the new version is '${major}.${minor}.${patch}'.`) + core.info(`The version could not be detected, using fallback version '${major}.${minor}.${patch}'.`) + } return `${major}.${minor}.${patch}` }