@@ -135,23 +135,33 @@ EOF
135135 }
136136 }
137137
138- // Escape backticks that might break template literal
139- const safeContent = reviewContent.replace(/`/g, '\\`');
140-
141- const summary = `## 🤖 Claude Docusaurus Review
142-
143- ${safeContent}
144-
145- ---
146-
147- <sub>Automated review by Claude Code</sub>`;
138+ // Use string concatenation instead of template literals to avoid syntax errors
139+ const summary = '## 🤖 Claude Docusaurus Review\n\n' +
140+ reviewContent +
141+ '\n\n---\n\n<sub>Automated review by Claude Code</sub>';
148142
149143 await github.rest.issues.createComment({
150144 issue_number: context.issue.number,
151145 owner: context.repo.owner,
152146 repo: context.repo.repo,
153147 body: summary
154148 });
149+
150+ console.log('Review posted successfully');
155151 } catch (error) {
156152 console.error('Error processing review:', error);
153+
154+ // Post error comment to notify about the failure
155+ try {
156+ await github.rest.issues.createComment({
157+ issue_number: context.issue.number,
158+ owner: context.repo.owner,
159+ repo: context.repo.repo,
160+ body: '## ❌ Claude Review Error\n\nFailed to process the review output. Please check the action logs for details.'
161+ });
162+ } catch (commentError) {
163+ console.error('Failed to post error comment:', commentError);
164+ }
165+
166+ core.setFailed(error.message);
157167 }
0 commit comments