fix(ci): replace envsubst with node for prompt templating#1238
fix(ci): replace envsubst with node for prompt templating#1238glottologist merged 2 commits intomasterfrom
Conversation
📝 WalkthroughWalkthroughReplaces a shell heredoc + Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Runner as "GitHub Actions Runner"
participant Node as "Node.js script (heredoc)"
participant Claude as "Claude CLI/API"
Runner->>Node: spawn Node heredoc script (with env)
Node->>Node: build prompt using JS template (interpolate env vars)
Node->>Claude: stream prompt via stdout to Claude CLI
Claude-->>Node: return response/output
Node-->>Runner: exit with streamed output
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/design-extraction.yml:
- Around line 200-220: The pipeline step that runs the heredoc piped into the
claude invocation (the `node <<'NODE_EOF' | npx claude` pipeline) can hide
failures from earlier commands; enable Bash pipefail so the step fails if `node`
or `npx claude` fails by setting the shell to use pipefail (e.g., set `shell:
bash -eo pipefail {0}` at the GitHub Actions step or add `set -o pipefail`
before the pipeline) so the heredoc/pipeline exit status is correctly
propagated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: facc8762-0292-4d49-bf35-84f5300651e9
📒 Files selected for processing (1)
.github/workflows/design-extraction.yml
|
Benchmark results: https://irys-xyz.github.io/irys/dev/bench/jason%2Ffix-extraction/index.html |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/design-extraction.yml:
- Around line 204-214: The prompt construction interpolates unescaped PR content
into the const prompt using process.env.DESIGN_PLAN and process.env.PR_COMMENTS
inside the <design_plan> and <pr_comments> tags, allowing those values to
prematurely close the tags; fix this by sanitizing or encoding those environment
values before interpolation (e.g., escape "</design_plan>" and "</pr_comments>"
or JSON.stringify/base64-encode the values) so the text cannot break out of the
tag blocks, and update the prompt assembly where the variable prompt is defined
to use the sanitized versions of process.env.DESIGN_PLAN and
process.env.PR_COMMENTS.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 47721cf6-5984-4cc9-bd42-31bfb1fe4ad0
📒 Files selected for processing (1)
.github/workflows/design-extraction.yml
Describe the changes
A clear and concise description of what the bug fix, feature, or improvement is.
Related Issue(s)
Please link to the issue(s) that will be closed with this PR.
Checklist
Additional Context
Add any other context about the pull request here.
Summary by CodeRabbit