File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/MyWebApi/MyWebApi/Controllers Expand file tree Collapse file tree 2 files changed +5
-6
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,
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ public InfoController(ILogger<InfoController> logger)
1717 public IActionResult Get ( )
1818 {
1919 var helloworld = "Hello World" ;
20- // Log a message at the Information level
2120 var message = "Hello World from InfoController. This is a sample message." ;
2221 _logger . LogInformation ( message ) ;
2322 return Ok ( message ) ;
You can’t perform that action at this time.
0 commit comments