From bf02af4c42b23655e13957d556c82c98328db96a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 20 Apr 2020 13:30:36 +0100 Subject: [PATCH] Allow spaces in the addSections option 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. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7ee9cee..0708bb9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -34,7 +34,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