fix: checkout repo in Test Report so test-reporter can list tracked files#346
Merged
Conversation
…iles The Test Report workflow runs via workflow_run with no checkout. With a manual download-artifact step (used to merge per-version test-results-* artifacts into one unified report), dorny/test-reporter falls back to 'git ls-files' to resolve source paths for annotations and fails with 'fatal: not a git repository'. It only uses the GitHub REST API for file listing when it downloads the artifact itself via the 'artifact:' input. Add an actions/checkout step (pinned to workflow_run.head_sha) before the download so git ls-files succeeds and annotations map to the tested commit, while preserving the single unified report. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Test Reportworkflow (test-report.yml, introduced in #345 / commit 6e14a0d) runs viaworkflow_runwithout checking out the repository. It downloads the per-versiontest-results-*artifacts with a manualdownload-artifactstep (merge-multiple: true) to build a single unified report, then passes onlypath:todorny/test-reporter.dorny/test-reporteronly uses the GitHub REST API to list tracked files (for resolving source paths in failure annotations) when it downloads the artifact via theartifact:input. With the manual-download +path:setup it falls back togit ls-files, which fails:Because
test-report.ymlruns frommain, this currently fails for every PR.Fix
Add an
actions/checkout@v6step before the artifact download, pinned toworkflow_run.head_sha, so:git ls-filesfinds a repository, andThe single unified report behavior is preserved (no switch to the per-artifact
artifact:input).Notes
download-artifactso its default cleaning does not remove the downloadedTestResults.contents: readis needed, which the job already grants.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com