fix: honour pre-release flag for default version

if there is no previous version and no explicit fallback version is specified emit a pre-release version (0.1.0-rc.0 by default) if the pre-release flag is true.
releases/v3
Patrick Dreker 2022-11-23 10:13:36 +01:00
parent c989d559ea
commit e63e00c563
No known key found for this signature in database
GPG Key ID: 5492FCBC60059A4E
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,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-version-file`: Do not update the version file. Default `'false'`.
- **Optional** `skip-commit`: Do not create a release commit. Default `'false'`. - **Optional** `skip-commit`: Do not create a release commit. Default `'false'`.
- **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default. - **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default.
- **Optional** `fallback-version`: The fallback version, if no older one can be detected, or if it is the first one. 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'`. If `pre-release`is set to `true` it will default to the configured pre-release format (i.e. `'0.1.0-rc.0'`)
- **Optional** `config-file-path`: Path to the conventional changelog config file. If set, the preset setting will be ignored - **Optional** `config-file-path`: Path to the conventional changelog config file. If set, the preset setting will be ignored
- **Optional** `pre-changelog-generation`: Path to the pre-changelog-generation script file. No hook by default. - **Optional** `pre-changelog-generation`: Path to the pre-changelog-generation script file. No hook by default.
- **Optional** `skip-ci`: Adds instruction to Github to not consider the push something to rebuild. Default `true`. - **Optional** `skip-ci`: Adds instruction to Github to not consider the push something to rebuild. Default `true`.

View File

@ -25,7 +25,7 @@ module.exports = async (releaseType, version) => {
newVersion = version newVersion = version
} else { } else {
// default // default
newVersion = '0.1.0' newVersion = (prerelease ? `0.1.0-${identifier}.0` : '0.1.0')
} }
core.info(`The version could not be detected, using fallback version '${newVersion}'.`) core.info(`The version could not be detected, using fallback version '${newVersion}'.`)