If any artifact exists in the target branch run that is not explicitly the coverage file, you'll get a conflict on download.
Download code coverage results from target branch
++ gh run list --status=success --branch=main --workflow=CI --event=push --json=databaseId --limit=1 -q '.[] | .databaseId'
+ LAST_SUCCESSFUL_RUN_ID=9388144932
+ '[' -z 9388144932 ']'
+ gh run download 9388144932 --name=unit-test-output --dir=.github/outputs
error downloading unit-test-output: error extracting zip archive: error extracting "x-report.json": open .github/outputs/x-report.json: file exists
This likely occurs because to avoid the conflict, the previous step renames the coverage file to NEW_COVERAGE_PATH, but it only does so for the COVERAGE_FILE_NAME and not extraneous files in the artifact. I'd recommend renaming the output directory to --dir=.github/outputs/new_coverage and --dir=.github/outputs/old_coverage respectively.
Ah I see. So when you upload your code coverage artifact, you might actually chose to include other files as well such as different formats of the code coverage results.
If any artifact exists in the target branch run that is not explicitly the coverage file, you'll get a conflict on download.
This likely occurs because to avoid the conflict, the previous step renames the coverage file to
NEW_COVERAGE_PATH
, but it only does so for theCOVERAGE_FILE_NAME
and not extraneous files in the artifact. I'd recommend renaming the output directory to--dir=.github/outputs/new_coverage
and--dir=.github/outputs/old_coverage
respectively.