You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use environment variables for action outputs in github-script
The AI review output can contain backticks and other special characters
that break JavaScript template literals. Using environment variables
ensures the content is properly escaped and treated as a string.
const model = '${{ vars.AI_MODEL || 'anthropic/claude-sonnet-4' }}';
195
+
const review = process.env.REVIEW_COMMENT;
196
+
const model = process.env.AI_MODEL;
194
197
195
198
const comment = `## 🤖 AI Review\n\n${review}\n\n---\n` +
196
199
`*This review was automatically generated by \`${model}\` via OpenRouter. Please consider it as supplementary feedback alongside human review.*`;
@@ -229,7 +232,7 @@ jobs:
229
232
await github.rest.issues.createComment({
230
233
...context.repo,
231
234
issue_number: context.issue.number,
232
-
body: `## ⚠️ AI Review Failed\n\nThe AI review could not be completed. Status: ${steps.ai_review.outputs.review_status}\n\nThis could be due to:\n- API rate limiting\n- Large diff size\n- Temporary service issues\n\nPlease retry the review later or request manual review.`
235
+
body: `## ⚠️ AI Review Failed\n\nThe AI review could not be completed. Status: ${{ steps.ai_review.outputs.review_status }}\n\nThis could be due to:\n- API rate limiting\n- Large diff size\n- Temporary service issues\n\nPlease retry the review later or request manual review.`
233
236
});
234
237
235
238
// Fail the workflow step to indicate the review failure
0 commit comments