standard-version
standard-version copied to clipboard
--git-tag-fallback not working properly
Describe the bug I am using this tool in a non-NodeJS project and it is unable to identify the last tag.
Current behavior
When executed, it generates all the changelog from scratch and always tags as 1.1.0 unless I use the --release-as option and manually modify the CHANGELOG.md file.
Expected behavior It should detect what my last version tag is and:
- Generate only the new changes.
- Create the next tag accordingly.
Environment
standard-versionversion(s): 9.3.1- Node/npm version: v14.9.0/6.14.10
- OS: Mac OS 11.5.2
Additional context I can get my last tag with
$ git describe --tags $(git rev-list --tags --max-count=1)
v1.1.1
Maybe this helps - I had a similar problem and managed to skip looking for a package.json with the following settings in .versionrc.json:
{
"packageFiles": [],
"bumpFiles": []
}
With this, it used the last git tag instead.
Thanks, @rogamoore. That worked flawlessly!
having the same issue I want to only create a CHANGELOG file based on my last tags, but it outputs 1.0.0 fallback version
{
"skip": {
"release": true,
"bump": true,
"commit": true,
"tag": true
},
"infile": "public/CHANGELOG.md",
"git-tag-fallback": true,
"packageFiles": [],
"bumpFiles": []
}
meanwhile
$: git describe --tags $(git rev-list --tags --max-count=1)
outputs: 0.0.1-RC20
I had also the issue that the fallback to tags was not working properly in a CI environment (Github Actions). It had to do that I left an empty array as the value of packageFiles in my .versionrc.js file. Once I removed the empty array, it worked.
Strangely, it worked WITH the empty array on my local machine when dry-running the versioning.