Report .NET test checks directly on same-repository PRs - #874
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts GitHub Actions test reporting so same-repo pull requests get a first-class DotNET Tests Check Run directly from the CI workflow, while keeping the existing workflow_run-based reporting for pushes and fork PRs.
Changes:
- Add workflow-level permissions and a
dorny/test-reporter@v3step inCIto publish a Check Run for same-repo PRs. - Gate
tests-report.ymlso it skips reporting when the originatingworkflow_runcame from a same-repo pull request (avoids duplicate reports).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds permissions + publishes DotNET Tests Check Run directly from CI for same-repo PRs. |
| .github/workflows/tests-report.yml | Skips workflow-run reporting for same-repo PR-originated CI runs to prevent duplicate checks. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andrea Cuneo <kaildio@gmail.com>
02ab3cd to
237dec4
Compare
Configure security-and-quality queries, local threat modeling, C# no-build analysis, and docs/tests exclusions.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/codeql.yml:26
- These CodeQL workflow/config changes (adding tests/** to paths-ignore, switching to build-mode matrix include, and introducing a repo codeql-config.yml) are not mentioned in the PR description, which is focused on test check reporting. Please either update the PR description to cover the CodeQL scope change (including rationale/impact), or split these CodeQL adjustments into a separate PR to keep review and rollback isolated.
on:
push:
branches: [ "master" ]
paths-ignore:
- 'docs/**'
- 'tests/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
paths-ignore:
- 'docs/**'
- 'tests/**'
schedule:
Cache CodeQL project dependencies for faster advanced-setup analyses.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep wildcard exclusion patterns valid for the CodeQL configuration format.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/ci.yml:81
- This step won’t run when
dotnet testfails. In GitHub Actions, steps after a failure are skipped unless the condition includes a status check function likealways()/failure(). That means failing tests won’t publish the "DotNET Tests" check run, which is the main goal of this change.
- name: Publish test report for same-repository pull requests
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
uses: dorny/test-reporter@v3
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/ci.yml:15
- Workflow permissions grant
actions: write, which is broader than needed for publishing a Check Run. Prefer least-privilege here (typicallychecks: write+contents: readis sufficient) to reduce token blast radius on PRs.
permissions:
contents: read
actions: write
checks: write
.github/workflows/codeql.yml:26
- This PR’s description is focused on test check reporting, but it also changes CodeQL scope/config (adds
tests/**topaths-ignore, switches to a custom config file, and tweaks matrix/build-mode). If this is intentional, please document it in the PR description; otherwise consider moving the CodeQL changes to a separate PR to keep review/audit history focused.
on:
push:
branches: [ "master" ]
paths-ignore:
- 'docs/**'
- 'tests/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
paths-ignore:
- 'docs/**'
- 'tests/**'
schedule:
The
DotNET Testscheck was inconsistently published for PRs, especially for bot- and Copilot-authored branches, because reporting depended on a separateworkflow_run.CIfor same-repository pull requests.Test Reportfor pushes and fork-based pull requests.