Skip to content

Commit cc52d3e

Browse files
authored
Merge pull request #12 from LiteObject/feature/refactor_code
Add a blank line for better readability before the Upload Diff as Art…
2 parents 7655ac9 + 31ce662 commit cc52d3e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/code-review.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
run: |
4040
# Remove metadata lines and retain only actual code changes (+/-)
4141
grep -E '^(\+|-)' changes.diff | sed 's/^+/Added: /; s/^-/Removed: /' > sanitized_diff.txt
42+
4243

4344
# Step 4: Upload the diff file as an artifact (optional)
4445
- name: Upload Diff as Artifact
@@ -60,12 +61,21 @@ jobs:
6061
ollama list
6162
6263
# Step 7: Read the diff file and prepare the prompt for Ollama
64+
# - name: Prepare Prompt
65+
# id: prepare-prompt
66+
# run: |
67+
# DIFF=$(cat sanitized_diff.txt)
68+
# PROMPT=$(echo "Please review the following code changes and provide feedback:\n\n$DIFF\n\nFeedback:" | sed 's/"/\\"/g')
69+
# echo "prompt=$PROMPT" >> $GITHUB_ENV
70+
6371
- name: Prepare Prompt
64-
id: prepare-prompt
6572
run: |
6673
DIFF=$(cat sanitized_diff.txt)
6774
PROMPT=$(echo "Please review the following code changes and provide feedback:\n\n$DIFF\n\nFeedback:" | sed 's/"/\\"/g')
68-
echo "prompt=$PROMPT" >> $GITHUB_ENV
75+
echo "prompt<<EOF" >> $GITHUB_ENV
76+
echo "$PROMPT" >> $GITHUB_ENV
77+
echo "EOF" >> $GITHUB_ENV
78+
shell: /usr/bin/bash -e {0}
6979

7080
# Step 8: Perform code review using Ollama
7181
- name: Code Review

0 commit comments

Comments
 (0)