Skip to content

Simplify message in InfoController's Get method #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
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
12 changes: 9 additions & 3 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ jobs:
echo "Generating diff between ${{ github.base_ref }} and ${{ github.head_ref }}"
git diff origin/${{ github.base_ref }}...${{ github.head_ref }} > changes.diff

# Step 4: Sanitize the diff file
- name: Sanitize Diff
run: |
# Remove metadata lines and retain only actual code changes (+/-)
grep -E '^(\+|-)' changes.diff | sed 's/^+/Added: /; s/^-/Removed: /' > sanitized_diff.txt

# Step 4: Upload the diff file as an artifact (optional)
- name: Upload Diff as Artifact
uses: actions/upload-artifact@v4
with:
name: pr-diff
path: changes.diff
name: sanitized-pr-diff
path: sanitized_diff.txt

# Step 5: Install Ollama
- name: Install Ollama
Expand All @@ -57,7 +63,7 @@ jobs:
- name: Prepare Prompt
id: prepare-prompt
run: |
DIFF=$(cat changes.diff)
DIFF=$(cat sanitized_diff.txt)
PROMPT=$(echo "Please review the following code changes and provide feedback:\n\n$DIFF\n\nFeedback:" | sed 's/"/\\"/g')
echo "prompt=$PROMPT" >> $GITHUB_ENV

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public InfoController(ILogger<InfoController> logger)
public IActionResult Get()
{
// Log a message at the Information level
var message = "Hello World from InfoController. This is a sample message.";
var message = "Hello World from InfoController.";
_logger.LogInformation(message);
return Ok(message);
}
Expand Down
Loading