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

Allow spaces in the sections option #2

Merged
merged 5 commits into from Nov 16, 2020

Conversation

browniebroke
Copy link

@browniebroke browniebroke commented Apr 20, 2020

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

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. Adding single brackets around should fix this problem.
@browniebroke browniebroke changed the title Allow spaces in the addSections option Allow spaces in the sections option Apr 20, 2020
@browniebroke browniebroke marked this pull request as ready for review April 20, 2020 13:43
@browniebroke browniebroke mentioned this pull request Jul 18, 2020
@heinrichreimer heinrichreimer merged commit a5e64e3 into heinrichreimer:master Nov 16, 2020
@heinrichreimer
Copy link
Owner

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

@browniebroke browniebroke deleted the patch-2 branch November 16, 2020 10:20
@heinrichreimer heinrichreimer self-assigned this Nov 16, 2020
@heinrichreimer heinrichreimer added the bug Something isn't working label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

addSections issue
2 participants