Skip to content

feat: Add platform-specific package manager contexts (Brew, Chocolatey, Winget) #438

feat: Add platform-specific package manager contexts (Brew, Chocolatey, Winget)

feat: Add platform-specific package manager contexts (Brew, Chocolatey, Winget) #438

name: Claude Code Review
on:
pull_request_target:
types: [opened, synchronize]
workflow_dispatch:
inputs:
pr_number:
description: 'Pull Request number to review'
required: true
type: number
jobs:
external-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.PR_REVIEW }}
prompt: |
<task>
Review PR #${{ inputs.pr_number || github.event.pull_request.number }} in ${{ github.repository }}.
</task>
<instructions>
1. Read CLAUDE.md to understand TUnit's critical rules
2. Run `gh pr diff ${{ inputs.pr_number || github.event.pull_request.number }}` to see changes
3. Run `gh pr view ${{ inputs.pr_number || github.event.pull_request.number }} --comments` to check previous review comments
4. Determine which TUnit rules apply based on files changed
5. Read any files needed to understand context before commenting
Think carefully. Never speculate about code you haven't inspected.
</instructions>
<tunit_rules>
Check which rules apply based on files modified:
- IF changes touch TUnit.Core.SourceGenerator OR TUnit.Engine test discovery:
→ Verify dual-mode implementation (both paths must behave identically)
- IF source generator output changed:
→ Verify .verified.txt snapshots updated (never .received.txt)
- IF public API changed (TUnit.Core, TUnit.Engine, TUnit.Assertions):
→ Verify TUnit.PublicAPI snapshots updated
- IF reflection is used:
→ Verify [DynamicallyAccessedMembers] annotations for AOT compatibility
- IF changes touch hot paths (discovery, execution, data generation):
→ Flag unnecessary allocations or performance concerns
ALWAYS block: Any use of Microsoft.VisualStudio.TestPlatform (VSTest)
</tunit_rules>
<review_focus>
Flag only issues that matter:
- Critical: Bugs, TUnit rule violations, security issues (injection, XSS, command injection, secrets in code)
- Suggestions: Significantly better approaches (not minor preferences)
DO NOT comment on:
- Style handled by linters/formatters
- Minor naming preferences
- Self-explanatory code
- Intentional design choices
</review_focus>
<output_format>
## Summary
One sentence: what does this PR do?
## Critical Issues
Blocking problems that must be fixed. If none: "None found ✅"
## Suggestions
Optional improvements. If none, omit this section.
## Previous Review Status
If previous comments exist: note which issues were addressed or remain open.
If no previous comments: omit this section.
## Verdict
✅ **APPROVE** - No critical issues
⚠️ **REQUEST CHANGES** - Critical issues found
💬 **COMMENT** - Questions only, no blocking issues
</output_format>
Post your review using `gh pr comment ${{ inputs.pr_number || github.event.pull_request.number }} --body "YOUR_REVIEW"`.
claude_args: '--allowed-tools "Read,Glob,Grep,Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'