File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 6464 run : |
6565 PAYLOAD=$(jq -n \
6666 --arg model "$MODEL_NAME" \
67- --arg prompt "$prompt " \
67+ --arg prompt "$PROMPT " \
6868 '{
6969 model: $model,
7070 prompt: $prompt,
@@ -76,10 +76,10 @@ jobs:
7676 echo "RAW RESPONSE:\n$RAW_RESPONSE"
7777
7878 # Try to extract the response, fallback to a default message if not found
79- REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response')
79+ REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response // empty')
8080
81- if [ -z "$REVIEW" ]; then
82- echo "Model did not return a valid review. Check RAW_RESPONSE for errors ."
81+ if [ -z "$REVIEW" ] || [ "$REVIEW" = "null" ] ; then
82+ echo "Error: .response field is missing or empty in the API response ."
8383 REVIEW="Model did not return a valid review. RAW_RESPONSE: $RAW_RESPONSE"
8484 fi
8585
8888 with :
8989 github-token : ${{ secrets.GITHUB_TOKEN }}
9090 script : |
91- const review = process.env.REVIEW;
91+ const review = process.env.REVIEW || 'No review generated due to an error.' ;
9292 await github.rest.issues.createComment({
9393 owner: context.repo.owner,
9494 repo: context.repo.repo,
You can’t perform that action at this time.
0 commit comments