From a32b63580eaa718ce1189a83f3552c176c30d869 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Tue, 12 Aug 2025 09:25:25 -0700 Subject: [PATCH] Update workflow to guide Claude on posting PR comments - Provide clearer instructions for saving review to file - Add --repo flag to gh pr comment for explicit repository - Use heredoc pattern for better handling of multiline content --- .github/workflows/claude-auto-review-test.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-auto-review-test.yml b/.github/workflows/claude-auto-review-test.yml index 9775b33..17bcf76 100644 --- a/.github/workflows/claude-auto-review-test.yml +++ b/.github/workflows/claude-auto-review-test.yml @@ -31,9 +31,16 @@ jobs: - Overall architecture and design decisions - Documentation consistency - After completing your review, post it as a comment on the PR using this command: - gh pr comment ${{ github.event.pull_request.number }} --body "YOUR_REVIEW_HERE" + After completing your review, write it to a file then post it as a PR comment using these commands: - Format your review nicely with markdown, using headers, bullet points, and code blocks as needed. + 1. First save your review to a file: + cat > /tmp/pr-review.md << 'EOF' + YOUR_REVIEW_CONTENT_HERE + EOF + + 2. Then post it: + gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body-file /tmp/pr-review.md + + Make sure to format your review nicely with markdown headers, bullet points, and code blocks. anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} claude_args: "--allowedTools Bash(gh pr comment:*),Read,Grep,Glob"