Closed Bouni closed 7 months ago
😏 The My Pytest Coverage Comment / Live Test (pull_request)
action failed exactly because of #68 which will be solved by this PR.
Looks amazing, thank you so much for your contribution! 🚀 Your PR addressing such a complex problem is truly impressive and immensely valuable to this action. Will do a more deep review in the next few days and will release a new version :)
To be honset, It took me dozens of trail an error attempts on one of my projects and with each iteration I though, now I finally fixed it 😅
I was so happy to see that you already had the workflow_dispatch
case in you code, otherwise I would have been completely lost.
An thank you for providing this action by the way 👍🏽
Big thanks again for the effort, I release new version with your code https://github.com/MishaKav/pytest-coverage-comment/releases/tag/v1.1.51
You can use it:
- name: Pytest Coverage Comment
uses: MishaKav/pytest-coverage-comment@main
or use a specific version
- name: Pytest Coverage Comment
uses: MishaKav/pytest-coverage-comment@v1.1.51
This PR adds
workflow_run
to the events that can trigger this action. That way #68 can be solved by using a two staged actions setup like this for example:First a pytest action that generates
pytest-coverage.txt
andpytest.xml
and uploads these amoung a textfile with the PR number as workflow artifacts.And the second stage that actually creates the comment.
Important is that the name of the first worflow
name: Run unit tests
must be identical toworkflows: ["Run unit tests"]
in the second workflow.@asumagic did actually post a solution like the above in #68 but that failed because
workflow_run
was not an allowd trigger.The underlayng problem why the comment can not be created directly from a PR that comes from a forked repo is described in GitHubs Blog: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/