EnricoMi / publish-unit-test-result-action

GitHub Action to publish unit test results on GitHub
Apache License 2.0
601 stars 178 forks source link

Support for forked repositories is compliacted and does not work for me #597

Closed rugk closed 3 months ago

rugk commented 4 months ago

I tried following https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches, but it did not work.

As soon as you try to download it with a specific run ID, it cannot find it: https://github.com/PrivateBin/PrivateBin/actions/runs/8950164072/job/24585250115?pr=1303

What works:

PR for reference: https://github.com/PrivateBin/PrivateBin/pull/1303

EnricoMi commented 4 months ago

In step 4, the instructions say "Add the following workflow that publishes test results". This refers to a separate workflow. So in stead of adding the publish action to the Tests workflow, please create a new workflow file with the given example YAML.

rugk commented 4 months ago

Ah thanks a lot! That said, I changed it, but GitHub does not trigger the "Test results" workflow at all – and yes, obviously I've changed the name.

https://github.com/PrivateBin/PrivateBin/pull/1303

Possibly because the old workflow was cancelled (although that's also not intended, but that's a different issue, but the GitHub doc does not actually mention any "cancelled" or so event to be added. And after all, for all test runs that have completed (even if not all of them have), results should be available and be uploaded. Again the doc says it does not depend on whether it was success or failure though…

EnricoMi commented 4 months ago

The reason is that workflow_run events only execute workflows from master, so you first have to commit the PR (https://github.com/PrivateBin/PrivateBin/pull/1303) to master for it to get triggered.

EnricoMi commented 3 months ago

Looks like this works for you. Please reopen if you need anything else.