Update claude-review.yml

This commit is contained in:
pacnpal
2024-12-10 15:16:28 -05:00
committed by GitHub
parent 77b72e2ba8
commit 841588bc0b

View File

@@ -134,7 +134,7 @@ jobs:
$DIFF_CONTENT
\`\`\`" \
'{
"model": "claude-3-sonnet-20241022",
"model": "claude-3-sonnet-20240229",
"max_tokens": 4096,
"temperature": 0.7,
"messages": [{
@@ -144,12 +144,15 @@ jobs:
}')
# Make the API request
echo "Sending request to Claude API..."
RESPONSE=$(curl -s https://api.anthropic.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d "$REQUEST_BODY")
echo "Response received, checking for content..."
if echo "$RESPONSE" | jq -e '.content[0].text' > /dev/null; then
REVIEW=$(echo "$RESPONSE" | jq -r '.content[0].text')
@@ -165,7 +168,7 @@ jobs:
fi
- name: Post review comment
if: steps.changed-files.outputs.diff_size != '0'
if: success() && steps.changed-files.outputs.diff_size != '0'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}