Skip to content

Commit 28521be

Browse files
authored
Merge pull request #21 from LiteObject/feature/refactor_code
Remove commented log message in InfoController's Get method for clarity
2 parents e1e1bab + 1be7052 commit 28521be

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/code-review.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
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
@@ -88,7 +88,7 @@ jobs:
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,

src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)