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
26 changes: 24 additions & 2 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ jobs:
id: generate-diff
run: |
echo "Generating diff between origin/${{ github.base_ref }} and origin/${{ github.head_ref }}"
git diff --unified=10 origin/${{ github.base_ref }}...origin/${{ github.head_ref }} > changes.diff
git diff --unified=10 origin/${{ github.base_ref }}...origin/${{ github.head_ref }} > changes.diff

# Check if diff is empty
if [ ! -s changes.diff ]; then
echo "No changes detected"
echo "NO_CHANGES=true" >> $GITHUB_ENV
exit 0
fi

# Limit diff size to avoid token limits (first 100 lines)
head -100 changes.diff > limited_changes.diff
mv limited_changes.diff changes.diff

- name: Sanitize Diff
run: |
Expand Down Expand Up @@ -56,7 +67,18 @@ jobs:
# Verify model is available via API
echo "Verifying model availability via API..."
curl -s http://localhost:11434/api/tags | jq '.'


- name: Wait for Ollama to be ready
run: |
for i in {1..10}; do
if curl -s http://localhost:11434/api/tags | jq '.'; then
echo "Ollama is ready."
break
fi
echo "Waiting for Ollama to be ready..."
sleep 3
done

- name: Prepare Prompt
run: |
DIFF=$(cat sanitized_diff.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public InfoController(ILogger<InfoController> logger)
[HttpGet(Name = "Get")]
public IActionResult Get()
{
var _helloworld = "Hello World";
var _helloworld = "Hello World 123";
var message = "Hello World from InfoController. This is a sample message.";
_logger.LogInformation(message);
return Ok(message);
Expand Down