mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
Update claude-review.yml
This commit is contained in:
7
.github/workflows/claude-review.yml
vendored
7
.github/workflows/claude-review.yml
vendored
@@ -134,7 +134,7 @@ jobs:
|
|||||||
$DIFF_CONTENT
|
$DIFF_CONTENT
|
||||||
\`\`\`" \
|
\`\`\`" \
|
||||||
'{
|
'{
|
||||||
"model": "claude-3-sonnet-20241022",
|
"model": "claude-3-sonnet-20240229",
|
||||||
"max_tokens": 4096,
|
"max_tokens": 4096,
|
||||||
"temperature": 0.7,
|
"temperature": 0.7,
|
||||||
"messages": [{
|
"messages": [{
|
||||||
@@ -144,12 +144,15 @@ jobs:
|
|||||||
}')
|
}')
|
||||||
|
|
||||||
# Make the API request
|
# Make the API request
|
||||||
|
echo "Sending request to Claude API..."
|
||||||
RESPONSE=$(curl -s https://api.anthropic.com/v1/messages \
|
RESPONSE=$(curl -s https://api.anthropic.com/v1/messages \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "x-api-key: $ANTHROPIC_API_KEY" \
|
-H "x-api-key: $ANTHROPIC_API_KEY" \
|
||||||
-H "anthropic-version: 2023-06-01" \
|
-H "anthropic-version: 2023-06-01" \
|
||||||
-d "$REQUEST_BODY")
|
-d "$REQUEST_BODY")
|
||||||
|
|
||||||
|
echo "Response received, checking for content..."
|
||||||
|
|
||||||
if echo "$RESPONSE" | jq -e '.content[0].text' > /dev/null; then
|
if echo "$RESPONSE" | jq -e '.content[0].text' > /dev/null; then
|
||||||
REVIEW=$(echo "$RESPONSE" | jq -r '.content[0].text')
|
REVIEW=$(echo "$RESPONSE" | jq -r '.content[0].text')
|
||||||
|
|
||||||
@@ -165,7 +168,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Post review comment
|
- 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
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user