Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commits duplicate under new release versions in CHANGELOG.md #86

Open
fireflysemantics opened this issue Mar 21, 2024 · 4 comments
Open

Comments

@fireflysemantics
Copy link

Did a detailed writeup here.

https://stackoverflow.com/questions/78196255/get-release-it-to-put-each-new-commit-under-the-corresponding-release-version-in

This is what is happening:

## 1.2.0 (2024-03-20)


### Features

* add commit linting 5eee5b0
* add release it changelog generation 80e627c

## 1.1.0 (2024-03-20)


### Features

* add release it changelog generation 80e627c

When the CHANGELOG.md is regenerated with new version numbers, previous commits are also rendered under the new version number, in addition to being rendered where they were previously.

@webpro
Copy link
Contributor

webpro commented Apr 5, 2024

You can use -VV and/or --debug to see better what's going on.

@fireflysemantics
Copy link
Author

I tried --debug to have a look at this is the result.

ri % npx release-it --no-git --debug
WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.

🚀 Let's release ri (1.1.0...1.2.0)


Changelog:
## 1.2.0 (2024-04-05)

### Features
* add commit linting 23ac6f1
* add release it changelog generation 821442f

? Create a release on GitHub (Release 1.2.0)? No

Thoughts?

@webpro
Copy link
Contributor

webpro commented Apr 5, 2024

I'm sorry, I meant NODE_DEBUG=release-it:* release-it [...]

https://github.com/release-it/release-it?tab=readme-ov-file#troubleshooting--debugging

@0xMurage
Copy link

0xMurage commented Oct 24, 2024

Based on the details you provided on SO, it seems you have disabled git tagging. Without git tags and a reference point for analyzing the commits, everything since the beginning of your repository's commits will be included.

As a workaround, one need to provide the commit SHA or reference from the last changelog entries. Here’s how you can do that:

const LAST_COMMIT_REF = "80e627c";

module.exports = {

    plugins: {

        '@release-it/conventional-changelog': {
            infile: 'CHANGELOG.md',
            preset: 'conventionalcommits',
            type: [
               { "type": "feat","section": "Features"  },
               { "type": "fix",  "section": "Bug Fixes"   }
            ],
            gitRawCommitsOpts: {
                from: LAST_COMMIT_REF
            },
            commitsOpts: {
                from: LAST_COMMIT_REF, 
            },
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants