zyborg / pester-tests-report

GitHub Action to run Pester tests and generate report attached to Workflow Run
MIT License
40 stars 13 forks source link

Test Result Report Attaching To Incorrect Workflow Run #20

Closed stevexiong-hennepin closed 1 month ago

stevexiong-hennepin commented 2 years ago

I have a dev test workflow with over 234 workflow runs. New workflow runs will not add the test result report to its current workflow run . Instead, it adds all new test result reports to this some 234 workflow run. In other words, this 234 workflow run has all new test result reports attached to it. I confirmed this by deleting workflow runs to have a total of 233 workflow runs, executed two more runs, verified there was no issue on the 234 run, and the issue occurs on 235 run and so on.

gerardog commented 2 years ago

I have the same problem at https://github.com/gerardog/gsudo/tree/master/.github/workflows

Feel free to fork gerardog/gsudo, edit the readme.md on master to trigger ci, then create a release with tag on the new commit, and you will see the problem.

natescherer commented 2 years ago

Ran into this myself, discovered this is actually a limitation in how check runs work. Check runs are attached to specific commits, not workflow runs: https://docs.github.com/en/rest/checks/runs

So if your workflow trigger isn't something that also changes the commit, there's no way for the check run to show up on that workflow. Kinda sucks but there's no working around this without major changes from GitHub.

FWIW, I added #23 which will block check run updates for workflow_dispatch and throw a notice about it.