Skip to content

Commit f4cb44d

Browse files
committed
fix(ci): pipe prompt via stdin in spec-review workflow
The claude --print command failed because shell expansion of $(cat /tmp/pr-diff.txt) inside double quotes broke on diffs containing special characters. Build the prompt in a file and pipe it via stdin instead.
1 parent b496f8d commit f4cb44d

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/spec-review.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ jobs:
6161
# Get the diff for review
6262
gh pr diff ${{ github.event.pull_request.number }} > /tmp/pr-diff.txt
6363
64-
# Run Claude Code review
65-
REVIEW=$(claude --print \
66-
--allowedTools "mcp__ecma-spec__search_ecma_spec,mcp__ecma-spec__get_section,mcp__ecma-spec__list_parts" \
67-
"Review this PR for OOXML spec compliance.
64+
# Build prompt in a file to avoid shell expansion issues
65+
cat > /tmp/prompt.txt <<'PROMPT_EOF'
66+
Review this PR for OOXML spec compliance.
6867
6968
Context: These are OOXML element handlers (XML ↔ ProseMirror JSON converters).
7069
@@ -87,12 +86,16 @@ jobs:
8786
- File and line number
8887
8988
Keep it concise. Don't quote the spec extensively - link to https://ooxml.dev/spec?q=<element name> for details.
89+
PROMPT_EOF
9090
91-
Changed files:
92-
${{ steps.changed.outputs.files }}
91+
# Append dynamic content (outside single-quoted heredoc so variables expand safely)
92+
printf '\nChanged files:\n%s\n\nDiff:\n' '${{ steps.changed.outputs.files }}' >> /tmp/prompt.txt
93+
cat /tmp/pr-diff.txt >> /tmp/prompt.txt
9394
94-
Diff:
95-
$(cat /tmp/pr-diff.txt)")
95+
# Run Claude Code review (pipe prompt via stdin)
96+
REVIEW=$(claude --print \
97+
--allowedTools "mcp__ecma-spec__search_ecma_spec,mcp__ecma-spec__get_section,mcp__ecma-spec__list_parts" \
98+
< /tmp/prompt.txt)
9699
97100
# Save review output
98101
echo "$REVIEW" > /tmp/review-raw.txt

0 commit comments

Comments
 (0)