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

addSections issue #3

Closed
skyem-hca opened this issue Jun 16, 2020 · 7 comments · Fixed by #2
Closed

addSections issue #3

skyem-hca opened this issue Jun 16, 2020 · 7 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@skyem-hca
Copy link

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?

@renehernandez
Copy link

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

@renehernandez
Copy link

renehernandez commented Jul 16, 2020

Example here: https://github.com/renehernandez/camper/blob/master/.github/workflows/ci_changelog.yml#L26

@browniebroke
Copy link

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

@corvis
Copy link

corvis commented Nov 15, 2020

I'm struggling from the same issue too. @heinrichreimer any chance you could review the proposed PR anytime soon?

@janheinrichmerker
Copy link
Owner

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.

@corvis
Copy link

corvis commented Nov 16, 2020

Perfect! Many thanks for the quick reaction and the super useful action.

@janheinrichmerker janheinrichmerker self-assigned this Nov 16, 2020
@janheinrichmerker janheinrichmerker added the bug Something isn't working label Nov 16, 2020
janheinrichmerker added a commit that referenced this issue Nov 16, 2020
@janheinrichmerker
Copy link
Owner

I've now applied @browniebroke's fix to some other inputs as well.
Hope I didn't miss one.

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 a pull request may close this issue.

5 participants