ncipollo / release-action

An action which manages a github release

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Body markdown broken on multiline input

bhoehl opened this issue · comments

Markdown is corrupted when using getInput on body
getInput does trim whitespaces when not specifying.

To Reproduce
Steps to reproduce the behavior:
use a body with markdown:

- test
 - test 2
 - test 3
  1. check release notes: there is no indention anymore

It is easy to fix, but currently annoying when passing markdown as body.

body = core.getInput('body', { trimWhitespace: false })

Use the bodyFile input for nontrivial markdown bodies. That should preserve formatting.

While I think that this is a reasonable request I think this would have some likelihood of breaking existing workflows (for example if someone had some white space before their input).

@ncipollo I am sorry but I really don´t get what you are saying.
body is markdown format and bodyFile too
Why should they behave differently ?
You introduced a different behaviour by letting getInput trim all whitespaces in every line.
To me this is a bug.
It is possible to use bodyFile of course, but it is unneeded to create an additional file for that purpose.

This behavior has remained unchanged since the action was created, so this was not something new introduced.

I understand your argument but many people are using this action now. It is possible and likely that changing that input to not trim will break the expectation some have of the output (ie it's a breaking change). I don't want to make this breaking change since the action already provides an option to achieve what you are after.

ok, I get your point, sounds reasonable.
it is just a bit more complicated for me, anyhow.
thanks for the feedback

it works perfectly with bodyFile :)

one last thing, as you confirmed that body behaves differently than bodyFile, you should update the documentation.
so, that it reads somehow, simple MD with one line or similar, more than one line will break the layout.
then there is less confusion on usage, preferable bodyFile.
thanks

Fair - updated readme!