codacy / codacy-coverage-reporter-action

GitHub Action for the codacy-coverage-reporter
Other
56 stars 15 forks source link

[CY-6704] Upload coverage via workflow_run #67

Closed rageagainsthepc closed 3 months ago

rageagainsthepc commented 1 year ago

Hi,

I want to upload coverage reports from github workflows triggered by the workflow_run event in order to be able to access secrets even for coverage data coming from forks. Since these workflows are run from the default branch of the repository, they will be associated with an incorrect commit sha and are therefore not recognized as coverage data belonging to a feature branch. My idea was to pass the correct commit sha manually when uploading, but it does not look like the commit sha is explicitly passed anywhere here in this action. Do you have an idea how to solve this? Thanks in advance.

github-actions[bot] commented 1 year ago

Internal ticket created : CY-6704

SchoolGuy commented 1 year ago

I would like to put myself in CC for this ticket.

Codecov has a solution for this that is working reliably (I do not know how the implementation is working for them). The solution provided here is not sufficient because that means that the changes introduced to the workflows themselves cannot be tested anymore. Thus experiments need to be done to the target branch which leads to unnecessary cluttering of the target/stable branch.

I have a ticket in my project which tracks my efforts (atm none) in this regard: https://github.com/cobbler/cobbler/issues/3379

If the Codacy team requires a "guinea pig" for testing purposes I would like to volunteer here as this would obsolete yet another separate tool in the workflow for my contributors (which is why I switched away from Codecov for coverage).

DMarinhoCodacy commented 9 months ago

Hello @rageagainsthepc,

Thanks for your report.

This coverage-reporter-action is a smaller version of our coverage-reporter feature (find more info here: https://github.com/codacy/codacy-coverage-reporter). Our feature supports what you need to pass the commit sha when you upload coverage reports.

Small example:

bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r --commit-uuid

lolgab commented 3 months ago

This is now fixed by https://github.com/codacy/codacy-coverage-reporter/pull/492 Please, feel free to re-open if the action is not getting the correct commit SHA by default.