Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
run: |
PAYLOAD=$(jq -n \
--arg model "$MODEL_NAME" \
--arg prompt "$prompt" \
--arg prompt "$PROMPT" \
'{
model: $model,
prompt: $prompt,
Expand All @@ -76,10 +76,10 @@ jobs:
echo "RAW RESPONSE:\n$RAW_RESPONSE"

# Try to extract the response, fallback to a default message if not found
REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response')
REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response // empty')

if [ -z "$REVIEW" ]; then
echo "Model did not return a valid review. Check RAW_RESPONSE for errors."
if [ -z "$REVIEW" ] || [ "$REVIEW" = "null" ]; then
echo "Error: .response field is missing or empty in the API response."
REVIEW="Model did not return a valid review. RAW_RESPONSE: $RAW_RESPONSE"
fi

Expand All @@ -88,7 +88,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const review = process.env.REVIEW;
const review = process.env.REVIEW || 'No review generated due to an error.';
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public InfoController(ILogger<InfoController> logger)
public IActionResult Get()
{
var helloworld = "Hello World";
// Log a message at the Information level
var message = "Hello World from InfoController. This is a sample message.";
_logger.LogInformation(message);
return Ok(message);
Expand Down