Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support branch coverage #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eltoder
Copy link
Contributor

@eltoder eltoder commented Jun 8, 2024

Branch coverage parsing is only implemented for the xml coverage format. If there is interest, I can look into parsing the text format as well.

@eltoder eltoder force-pushed the feature/branch-coverage branch from 645be98 to 74be0bb Compare June 8, 2024 01:39
Branch coverage parsing is only implemented for the xml coverage format.
@eltoder eltoder force-pushed the feature/branch-coverage branch from 74be0bb to 2956499 Compare June 8, 2024 02:32
@eltoder
Copy link
Contributor Author

eltoder commented Jun 8, 2024

@MishaKav Looks like the workflow doesn't work in forks

@MishaKav
Copy link
Owner

MishaKav commented Jun 8, 2024

Thanks for the PR, it's a great feature,
it has some problems with forks #68 , I will try to find some time, to test your changes and to merge them.

@eltoder
Copy link
Contributor Author

eltoder commented Jun 8, 2024

@MishaKav thank you. Let me know if you have any comments in the PR, happy to fix or improve it.

@eltoder
Copy link
Contributor Author

eltoder commented Jun 22, 2024

@MishaKav It looks like to fix the issues in the pipeline, the two common approaches are to either

  1. Use the pull_request_target trigger instead of pull_request. Set the minimal permissions for the job, probably {repo: read, issues: write}. There is a small chance that someone will abuse this, but since you review the changes before triggering the workflow, it should be pretty safe. Some background on this is given here.
  2. Add a workflow_run workflow in addition to the pull_request one you have. For this, you'll need to add an option to your action to save the output as a, say, json file instead of posting the comment directly. In the pull_request workflow you will produce that json file and upload it as an artifact. Then in the workflow_run you will download that artifact and post it as a comment. See here for an example. This is clearly more work than option 1, but the advantage is that no untrusted code ever runs with access to your project. Other people using your action to can use this approach as well.

Let me know if you are interested in implementing either of the options.

@MishaKav
Copy link
Owner

MishaKav commented Jul 1, 2024

I reviewed your PR in GitHub, and it looks good.
Since I don't have UnitTests, I will run manual tests, to check if other things still work and there are no regressions.
I believe I will release a new version with your code in the next few days.
It's an amazing improvement to the current action!

@eltoder
Copy link
Contributor Author

eltoder commented Jul 1, 2024

@MishaKav thank you! FWIW I've been using this change for two months without issues. The caveat is that I use the xml format, so I did not update the text format parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants