Skip to content

Commit 31ce662

Browse files
committed
Refactor Prepare Prompt step to improve environment variable handling
1 parent 5d9b14b commit 31ce662

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/code-review.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,21 @@ jobs:
6161
ollama list
6262
6363
# 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+
6471
- name: Prepare Prompt
65-
id: prepare-prompt
6672
run: |
6773
DIFF=$(cat sanitized_diff.txt)
6874
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
75+
echo "prompt<<EOF" >> $GITHUB_ENV
76+
echo "$PROMPT" >> $GITHUB_ENV
77+
echo "EOF" >> $GITHUB_ENV
78+
shell: /usr/bin/bash -e {0}
7079

7180
# Step 8: Perform code review using Ollama
7281
- name: Code Review

0 commit comments

Comments
 (0)