Madrapps / jacoco-report

Github action that publishes the JaCoCo report as a comment in the Pull Request
https://github.com/marketplace/actions/jacoco-report
MIT License
144 stars 63 forks source link

Support workflow_run events (fix for Dependabot runs) #92

Open aaccioly opened 2 months ago

aaccioly commented 2 months ago

At the moment only pull_request, pull_request_target and pushevents are supported:

https://github.com/Madrapps/jacoco-report/blob/f4a835c46ef0f03b3ecefd583f22d7c857f34925/src/action.ts#L59-L75

While pull_request_target used to be the way to workaround "pull requests from forked repositories" issue, workflow_run is much more flexible. The current modern best practice for both "Pull requests from forked repositories" and "Dependabot PRs" scenarios is to have a pull_request workflow generating and uploading artifacts and a downstream workflow_run downloading generated artifacts and subsequently executing any privileged actions such as commenting on PRs.

Sample actions with first class support for workflow_run:

thsaravana commented 1 week ago

Interesting. Would you be able to create a PR against: https://github.com/thsaravana/jacoco-playground with this use-case so that I can test this out, and in turn use that to test the implementation as well?