thollander / actions-comment-pull-request

GitHub action to comment pull request
MIT License
329 stars 89 forks source link

Failing to add html file as comment on PR from forked repository #344

Closed george-gca closed 9 months ago

george-gca commented 9 months ago

I have a template repository and I'd like to add a prettier check before submitted PRs are accepted. Not only that, I'd like prettier to run and, case failed, to generate a diff output of which files should be changed for the PR to be accepted.

I was able to create such a workflow, where prettier runs and when failed an html diff is created. I was trying to include this html file as a comment on the PR with your action, but I couldn't. I saw in the docs that you suggest using pull_request_target, but in GitHub docs they have a warning about using this and pwn PRs.

Any idea of how to work it out?

george-gca commented 9 months ago

Just now I realized that it actually reads the files and tries to output it. Since it is an html it extrapolates the limit of chars. Changed my solution to point to a link where the artifact could be downloaded.