peter-evans / create-or-update-comment

A GitHub action to create or update an issue or pull request comment
MIT License
706 stars 113 forks source link

Error Argument list too long with very large comment bodies #234

Closed MatthewCane closed 1 year ago

MatthewCane commented 1 year ago

I am trying to post a very large message body (104k characters) containing the output of several Cloudformation changesets and I am getting the following error message:

An error occurred trying to start process '/home/runner/runners/2.306.0/externals/node16/bin/node' with working directory '/home/runner/work/<project>/<project>'. Argument list too long

If I copy the message body and make a comment manually it works, so I know this isn't a comment length limit. Is there anything that can be changed to facilitate this? I know it's a very large comment body and I may have to split it up over multiple comments but I would like to keep it as one if I can.

peter-evans commented 1 year ago

Hi @MatthewCane

There is information about why this happens here: https://github.com/peter-evans/create-or-update-comment/issues/96

For your case, I recommend dumping the output to a file, and then using the body-path input to read the comment body from the file. This bypasses the limitation of the Actions runner, as described in the issue I linked above.

MatthewCane commented 1 year ago

That's a great help, thank you!