Skip to content

Commit

Permalink
fix: honour pre-release flag for default version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pdreker committed Nov 23, 2022
1 parent c989d55 commit e63e00c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-commit`: Do not 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 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** `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`.
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/bumpVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = async (releaseType, version) => {
newVersion = version
} else {
// 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}'.`)
Expand Down

0 comments on commit e63e00c

Please sign in to comment.