@@ -66,24 +66,24 @@ jobs:
6666 - name : Create review prompt
6767 if : steps.check-files.outputs.skip_review != 'true'
6868 run : |
69- cat > /tmp/review-prompt.txt << 'REVIEW_PROMPT_EOF '
70- Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
69+ cat > /tmp/review-prompt.txt << 'EOF '
70+ Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
7171
72- Analyze changes to:
73- - docusaurus.config.js (site configuration, plugins, themes)
74- - sidebars.js (navigation structure)
75- - package.json (dependencies, scripts)
76- - Build configuration files
77- - Source code in src/ directory
78- - GitHub Actions workflows
72+ Analyze changes to :
73+ - docusaurus.config.js (site configuration, plugins, themes)
74+ - sidebars.js (navigation structure)
75+ - package.json (dependencies, scripts)
76+ - Build configuration files
77+ - Source code in src/ directory
78+ - GitHub Actions workflows
7979
80- For each issue found, provide:
81- 1. Clear explanation of the problem
82- 2. Specific code suggestion with reasoning
83- 3. Potential impact on the documentation site
80+ For each issue found, provide :
81+ 1. Clear explanation of the problem
82+ 2. Specific code suggestion with reasoning
83+ 3. Potential impact on the documentation site
8484
85- Ignore all .md and .mdx files - focus only on the technical infrastructure.
86- REVIEW_PROMPT_EOF
85+ Ignore all .md and .mdx files - focus only on the technical infrastructure.
86+ EOF
8787
8888 - name : Read system prompt for append
8989 if : steps.check-files.outputs.skip_review != 'true'
@@ -107,7 +107,7 @@ jobs:
107107 max_turns : " 20"
108108 model : " claude-sonnet-4-20250514"
109109
110- - name : Post review summary (bash)
110+ - name : Post review summary (bash)
111111 if : steps.claude-review.conclusion == 'success'
112112 env :
113113 EXECUTION_FILE : ${{ steps.claude-review.outputs.execution_file }}
@@ -119,30 +119,38 @@ jobs:
119119 exit 0
120120 fi
121121
122- # Extract the last assistant message using jq
123- REVIEW_CONTENT=$(jq -r '.[] | select(.role == "assistant") | .content' "$EXECUTION_FILE" | tail -1)
122+ # Extract the last assistant message using jq - handle the nested structure
123+ REVIEW_CONTENT=$(jq -r '
124+ .[] |
125+ select(.type == "assistant") |
126+ .message.content[]? |
127+ select(.type == "text") |
128+ .text
129+ ' "$EXECUTION_FILE" | tail -1)
124130
125131 if [ -z "$REVIEW_CONTENT" ]; then
126132 echo "No review content found"
133+ echo "Execution file contents:"
134+ cat "$EXECUTION_FILE" | jq '.' | head -100
127135 exit 0
128136 fi
129137
130138 # Create comment file with proper escaping
131139 cat > /tmp/comment.md << 'HEADER'
132- ## 🤖 Claude Docusaurus Review
140+ # # 🤖 Claude Docusaurus Review
133141
134- HEADER
142+ HEADER
135143
136144 # Append the review content
137145 echo "$REVIEW_CONTENT" >> /tmp/comment.md
138146
139147 # Add footer
140148 cat >> /tmp/comment.md << 'FOOTER'
141149
142- ---
150+ ---
143151
144- <sub>Automated review by Claude Code</sub>
145- FOOTER
152+ <sub>Automated review by Claude Code</sub>
153+ FOOTER
146154
147155 # Post comment using GitHub API
148156 jq -n --arg body "$(cat /tmp/comment.md)" '{body : $body}' | \
@@ -152,4 +160,4 @@ jobs:
152160 " https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" \
153161 -d @-
154162
155- echo "Review posted successfully"
163+ echo "Review posted successfully"
0 commit comments