Skip to content

Commit 9567f2b

Browse files
authored
Update sample-file-trigger.yml
1 parent aa7f6cd commit 9567f2b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/sample-file-trigger.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,24 @@ jobs:
2222
echo "No relevant file found. Exiting."
2323
exit 0
2424
fi
25+
echo "Changed file detected: $CHANGED_FILE"
2526
echo "file_path=$CHANGED_FILE" >> $GITHUB_ENV
2627
2728
- name: Read file content
2829
id: read_file
2930
run: |
3031
echo "Reading changed file content..."
31-
FILE_CONTENT=$(cat ${{ env.file_path }} | jq -Rs .)
32-
echo "file_content=$FILE_CONTENT" >> $GITHUB_ENV
32+
FILE_CONTENT=$(cat ${{ env.file_path }})
33+
echo "file_content<<EOF" >> $GITHUB_ENV
34+
echo "$FILE_CONTENT" >> $GITHUB_ENV
35+
echo "EOF" >> $GITHUB_ENV
3336
3437
- name: Extract Commands and Properties (OpenAI Part 1)
3538
id: extract_details
3639
run: |
3740
echo "Extracting commands and properties..."
38-
SYSTEM_PROMPT=$(jq -Rs . < .github/prompts/extract_prompt.txt)
39-
USER_CONTENT=${{ env.file_content }}
41+
SYSTEM_PROMPT=$(cat .github/prompts/extract_prompt.txt)
42+
USER_CONTENT="${{ env.file_content }}"
4043
4144
PAYLOAD=$(jq -n --arg sys "$SYSTEM_PROMPT" --arg usr "$USER_CONTENT" '{
4245
model: "gpt-4o",
@@ -56,8 +59,8 @@ jobs:
5659
id: generate_doc
5760
run: |
5861
echo "Generating final Markdown documentation..."
59-
SYSTEM_PROMPT=$(jq -Rs . < .github/prompts/generate_prompt.txt)
60-
EXTRACTED_CONTENT=$(jq -Rs . < extracted_info.md)
62+
SYSTEM_PROMPT=$(cat .github/prompts/generate_prompt.txt)
63+
EXTRACTED_CONTENT=$(cat extracted_info.md)
6164
6265
PAYLOAD=$(jq -n --arg sys "$SYSTEM_PROMPT" --arg usr "$EXTRACTED_CONTENT" '{
6366
model: "gpt-4o",

0 commit comments

Comments
 (0)