standard-version icon indicating copy to clipboard operation
standard-version copied to clipboard

--git-tag-fallback not working properly

Open pavel-kalmykov opened this issue 4 years ago • 4 comments
trafficstars

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:

  1. Generate only the new changes.
  2. Create the next tag accordingly.

Environment

  • standard-version version(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

pavel-kalmykov avatar Sep 06 '21 12:09 pavel-kalmykov

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.

rogamoore avatar Sep 13 '21 19:09 rogamoore

Thanks, @rogamoore. That worked flawlessly!

pavel-kalmykov avatar Sep 14 '21 14:09 pavel-kalmykov

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

PaulTime avatar Oct 14 '21 14:10 PaulTime

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.

JaapWeijland avatar Nov 19 '21 09:11 JaapWeijland