release-it / keep-a-changelog

Keep a Changelog plugin for release-it
MIT License
27 stars 15 forks source link

Does not work with `--no-increment` flag #22

Closed ofhouse closed 2 years ago

ofhouse commented 2 years ago

Hi, I tried to use the plugin in a CI system together with the --no-increment from the release-it CLI.

My workflow:

  1. Initial Changelog

    # Changelog
    
    ## [Unreleased]
    - Some changes
  2. Generate the release locally

    # Changelog
    
    ## [Unreleased]
    
    ## [v1.0.0]
    - Some changes
  3. Push the changes to GitHub
  4. Publish the release from CI
    release-it --no-increment --ci

Expected behavior

I would expect that the plugin does not try to update the changelog, when the --no-increment flag is set.

Actual behavior

The plugin throws an error when the "Unreleased" section is empty:

ERROR There are no entries under "Unreleased" section in CHANGELOG.md.