File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 39
39
run : |
40
40
# Remove metadata lines and retain only actual code changes (+/-)
41
41
grep -E '^(\+|-)' changes.diff | sed 's/^+/Added: /; s/^-/Removed: /' > sanitized_diff.txt
42
+
42
43
43
44
# Step 4: Upload the diff file as an artifact (optional)
44
45
- name : Upload Diff as Artifact
@@ -60,12 +61,21 @@ jobs:
60
61
ollama list
61
62
62
63
# 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
+
63
71
- name : Prepare Prompt
64
- id : prepare-prompt
65
72
run : |
66
73
DIFF=$(cat sanitized_diff.txt)
67
74
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}
69
79
70
80
# Step 8: Perform code review using Ollama
71
81
- name : Code Review
You can’t perform that action at this time.
0 commit comments