ci: post per-assembly coverage as sticky pr comment #33
No reviewers
Labels
No labels
bug
commercial
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jasoncouture/llama-shears!33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/pr-coverage-comment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PR-side coverage feedback. Uses the
run-testscomposite action introduced in PR #32 to compute coverage identically to main, then posts the per-assembly markdown summary as an upserted sticky comment under headercoverage.What's in here
.github/workflows/pr-coverage.yml:pull_requestagainstmainorrelease/**.contents: read,pull-requests: write(required for upsert).cancel-in-progress: true— only the latest commit's coverage is interesting.actions/checkout@v4(fetch-depth 0 for NBGV) →actions/setup-dotnet@v4(10.0.x) → local./.github/actions/run-tests→marocchino/sticky-pull-request-comment@v2postingcode-coverage-results.mdunder headercoverage.Why marocchino/sticky-pull-request-comment
It's the canonical "upsert one comment with this header" action, with explicit support for the marker-comment pattern that survives across pushes. Per repo policy, pinned to floating major (
@v2).Failure behavior
Tests failing aborts the
run-testsaction before the markdown is generated; no comment is posted on a failing build. The PR check reports red regardless. This matches the agreed-upon "just fail" behavior for PR 2.Test plan
docs-api-up-to-datepre-push check passed.main.Stacking note
Targets
ci/run-tests-action(PR #32). Will retargetmainautomatically when #32 merges.🤖 Generated with Claude Code
All committers have signed the CLA.
Pull request overview
Adds a PR-triggered GitHub Actions workflow that runs the repo’s standardized test+coverage pipeline and posts the per-assembly coverage markdown as an upserted (“sticky”) PR comment.
Changes:
pr-coverageworkflow triggered onpull_requesttomain/release/**../.github/actions/run-teststo producecode-coverage-results.md.coverage) from the generated markdown.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -0,0 +9,4 @@permissions:contents: readpull-requests: writeThe workflow grants
pull-requests: writefor the whole job, and the job executes PR code duringdotnet test. That exposes a write-capable token to untrusted code (e.g., it can be extracted from checkout git credentials) and increases blast radius if a test is compromised. Consider splitting into two jobs (test/coverage with read-only permissions + artifact, then a second job withpull-requests: writethat downloadscode-coverage-results.mdand posts the sticky comment), or otherwise scope write permissions to the minimal job that needs them.@ -0,0 +33,4 @@uses: marocchino/sticky-pull-request-comment@v2with:path: code-coverage-results.mdheader: coverageThe comment-posting step may fail on PRs where
GITHUB_TOKENcannot be granted write permissions (commonly PRs from forks), which would turn the whole check red even if tests/coverage succeeded. Consider guarding this step to only run for same-repo PRs (or otherwise handling the no-write-token case gracefully) so forked PRs still get a useful green signal from the coverage job.