heinrichreimer / action-github-changelog-generator

✏️ Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
MIT License
127 stars 34 forks source link

Allow spaces in the sections option #2

Closed browniebroke closed 3 years ago

browniebroke commented 4 years ago

Changes

I tried to use the option for adding extra section with the following value:

addSections: '{"documentation":{"prefix":"### Documentation updates:","labels":["documentation"]}}'

However, this result in the following error:

/usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator/generator/entry.rb:71:in `rescue in parse_sections': There was a problem parsing your JSON string for sections: 767: unexpected token at '{"documentation":{"prefix":"###' (RuntimeError)

So basically, the option is split on the first space, causing an invalid value to be passed to the underlying script.

This is a problem for all the sections-related option.

Fixes #3

Implementation details

For each option, we need to instead do:

More context

Here is an example of a problematic run and here is an example of run with the fix.

This is the config I'm currently using: https://github.com/browniebroke/deezer-python/blob/master/.github/workflows/changelog-generator.yml

heinrichreimer commented 3 years ago

Thanks for your PR 🥳 Sorry I kept this open for so long. I've lost track of my GitHub projects a bit during university.