File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,18 @@ jobs:
3434 echo "Generating diff between ${{ github.base_ref }} and ${{ github.head_ref }}"
3535 git diff origin/${{ github.base_ref }}...${{ github.head_ref }} > changes.diff
3636
37+ # Step 4: Sanitize the diff file
38+ - name : Sanitize Diff
39+ run : |
40+ # Remove metadata lines and retain only actual code changes (+/-)
41+ grep -E '^(\+|-)' changes.diff | sed 's/^+/Added: /; s/^-/Removed: /' > sanitized_diff.txt
42+
3743 # Step 4: Upload the diff file as an artifact (optional)
3844 - name : Upload Diff as Artifact
3945 uses : actions/upload-artifact@v4
4046 with :
41- name : pr-diff
42- path : changes.diff
47+ name : sanitized- pr-diff
48+ path : sanitized_diff.txt
4349
4450 # Step 5: Install Ollama
4551 - name : Install Ollama
5763 - name : Prepare Prompt
5864 id : prepare-prompt
5965 run : |
60- DIFF=$(cat changes.diff )
66+ DIFF=$(cat sanitized_diff.txt )
6167 PROMPT=$(echo "Please review the following code changes and provide feedback:\n\n$DIFF\n\nFeedback:" | sed 's/"/\\"/g')
6268 echo "prompt=$PROMPT" >> $GITHUB_ENV
6369
You can’t perform that action at this time.
0 commit comments