Skip to content

Commit

Permalink
Allow spaces in the addSections option
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
browniebroke authored and Bruno Alla committed Apr 20, 2020
1 parent 0168e29 commit b2fcf2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -n "$INPUT_OUTPUT" ]; then ARG_OUTPUT="--output $INPUT_OUTPUT"; fi
if [ -n "$INPUT_BASE" ]; then ARG_BASE="--base $INPUT_BASE"; fi
if [ -n "$INPUT_HEADERLABEL" ]; then ARG_HEADERLABEL="--header-label $INPUT_HEADERLABEL"; fi
if [ -n "$INPUT_CONFIGURESECTIONS" ]; then ARG_CONFIGURESECTIONS="--configure-sections $INPUT_CONFIGURESECTIONS"; fi
if [ -n "$INPUT_ADDSECTIONS" ]; then ARG_ADDSECTIONS="--add-sections $INPUT_ADDSECTIONS"; fi
if [ -n "$INPUT_ADDSECTIONS" ]; then ARG_ADDSECTIONS="--add-sections '$INPUT_ADDSECTIONS'"; fi
if [ -n "$INPUT_FRONTMATTER" ]; then ARG_FRONTMATTER="--front-matter $INPUT_FRONTMATTER"; fi
if istrue "$INPUT_ISSUES"; then ARG_ISSUES="--issues"; else ARG_ISSUES="--no-issues"; fi
if istrue "$INPUT_ISSUESWOLABELS"; then ARG_ISSUESWOLABELS="--issues-wo-labels"; else ARG_ISSUESWOLABELS="--no-issues-wo-labels"; fi
Expand Down

0 comments on commit b2fcf2c

Please sign in to comment.