create-or-update-comment icon indicating copy to clipboard operation
create-or-update-comment copied to clipboard

Plaint text without formating?

Open rvalitov opened this issue 1 year ago • 7 comments

Hi! I need to print output from console, therefore it should be printed "as is", as a plain text with standard line endings and without markdown formatting. Is it possible to disable markdown formatting?

rvalitov avatar Nov 30 '24 21:11 rvalitov

Hi @rvalitov

Sorry, I don't understand what you are trying to do. Please could you show me a workflow and explain what currently happens and what you want to happen.

peter-evans avatar Dec 02 '24 10:12 peter-evans

Please let me know if I'm mistaken. I just made my conclusion based on the documentation in your Readme file. It says that the text I pass to your workflow is treated as markdown format and will be formatted accordingly. What I need is to avoid any formatting. Is there any option for that?

rvalitov avatar Dec 02 '24 14:12 rvalitov

The action doesn't do any formatting. It just takes the text you pass to body and calls the GitHub API. If you want text to be rendered nicely on GitHub you can pass markdown, but it's not required.

peter-evans avatar Dec 02 '24 15:12 peter-evans

So, if I pass **bold text** to body what the resulting comment will be? I suppose it will be a string bold text? Can you please give an advice how just to print the **bold text** message and other Markdown tags "as is", without any formatting?

rvalitov avatar Dec 02 '24 15:12 rvalitov

So, if I pass **bold text** to body what the resulting comment will be? I suppose it will be a string bold text? Can you please give an advice how just to print the **bold text** message and other Markdown tags "as is", without any formatting?

Oh, I understand what you mean now. Just to clarify, the formatting is applied on GitHub itself because all comments are rendered as markdown. Probably the easiest way to "escape" markdown is to wrap it in a code block, exactly as you've done it your comment.

**bold text**

peter-evans avatar Dec 02 '24 16:12 peter-evans

Thank you, I had the same idea, but that won't work in a general case, because I need to output text that is dynamically generated by other tools, so it may contain Markdown code block formatting, that may break the rendering... I was hoping there was a special option for that, or perhaps a different GitHub API endpoint URL for printing unformatted text...

rvalitov avatar Dec 02 '24 16:12 rvalitov

I'm not aware of any special way to do that. You'll just need to find a way to escape the code blocks somehow.

peter-evans avatar Dec 02 '24 16:12 peter-evans