Closed skyem-hca closed 3 years ago
I forked the repo and ran it several times with debugging changes on my repo and it turns out the issue is with word splitting.
I enabled set -o xtrace
on the entrypoint.sh
script and with addSections
in the action usage as follow:
addSections: '{"documentation":{"prefix":"**Documentation updates:**","labels":["documentation"]}}'
then the command that ends up being executed is:
github_changelog_generator --user renehernandez --project camp3 --token *** --add-sections '{"documentation":{"prefix":"**Documentation' 'updates:**","labels":["documentation"]}}' --issues --issues-wo-labels --pull-requests --pr-wo-labels --no-filter-by-milestone --no-author --unreleased --unreleased-label true --no-compare-link --no-verbose
Notice how an extra pair of single quotes gets added separating Documentation and updates word, making it an invalid json string.
It works fine if I just use Documentation instead of Documentation updates
I think it's the same issue I had with spaces in sections. I suggested a fix in #2 and I've been using it successfully in my projects since. You can see an example here:
https://github.com/browniebroke/django-codemod/blob/master/.github/workflows/changelog-generator.yml
I'm struggling from the same issue too. @heinrichreimer any chance you could review the proposed PR anytime soon?
Thanks for bringing this to my attention! I've now merged the bugfix. Thanks to @browniebroke! I've also updated this project to use the action itself, so that we should see issues earlier.
Perfect! Many thanks for the quick reaction and the super useful action.
I've now applied @browniebroke's fix to some other inputs as well. Hope I didn't miss one.
I've been unable to get addSections to work. I tried using the example input from the linked page, and tried manipulating it for yaml too with no success. I've always either gotten a 'Workflow is not valid: mapping was not expected' from Github, or
/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: 416: unexpected token at '{"documentation":{"prefix":"**Documentation' (RuntimeError)` when I got it to parse the yaml.Do you have any tips?