Skip to content

Commit 4149039

Browse files
authored
Update agent-docusarus-dev.yml
1 parent af675d2 commit 4149039

File tree

1 file changed

+35
-38
lines changed

1 file changed

+35
-38
lines changed

.github/workflows/agent-docusarus-dev.yml

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ on:
1212
jobs:
1313
claude-review:
1414
runs-on: ubuntu-latest
15-
15+
1616
permissions:
1717
contents: read
1818
pull-requests: write
19-
19+
2020
steps:
2121
- name: Checkout code
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 2
25-
25+
2626
- name: Fetch system prompt from private repo
2727
id: fetch-prompt
2828
env:
@@ -45,15 +45,14 @@ jobs:
4545
4646
echo "$CONTENT" > /tmp/system-prompt.md
4747
echo "System prompt fetched successfully"
48-
48+
4949
- name: Check for Docusaurus changes
5050
id: check-files
5151
run: |
5252
CHANGED_FILES=$(git diff --name-only HEAD~1)
53-
54-
# Focus on Docusaurus infrastructure files
53+
5554
DOCUSAURUS_FILES=$(echo "$CHANGED_FILES" | grep -E "(docusaurus\.config\.js|sidebars?\.js|babel\.config\.js|package\.json|\.github/|src/)" || true)
56-
55+
5756
if [ -z "$DOCUSAURUS_FILES" ]; then
5857
echo "No Docusaurus infrastructure files changed. Skipping review."
5958
echo "skip_review=true" >> $GITHUB_OUTPUT
@@ -64,29 +63,29 @@ jobs:
6463
echo "$DOCUSAURUS_FILES" >> $GITHUB_STEP_SUMMARY
6564
echo '```' >> $GITHUB_STEP_SUMMARY
6665
fi
67-
66+
6867
- name: Create review prompt
6968
if: steps.check-files.outputs.skip_review != 'true'
7069
run: |
7170
cat > /tmp/review-prompt.txt << 'EOF'
72-
Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
73-
74-
Analyze changes to:
75-
- docusaurus.config.js (site configuration, plugins, themes)
76-
- sidebars.js (navigation structure)
77-
- package.json (dependencies, scripts)
78-
- Build configuration files
79-
- Source code in src/ directory
80-
- GitHub Actions workflows
81-
82-
For each issue found, provide:
83-
1. Clear explanation of the problem
84-
2. Specific code suggestion with reasoning
85-
3. Potential impact on the documentation site
86-
87-
Ignore all .md and .mdx files - focus only on the technical infrastructure.
88-
EOF
89-
71+
Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
72+
73+
Analyze changes to:
74+
- docusaurus.config.js (site configuration, plugins, themes)
75+
- sidebars.js (navigation structure)
76+
- package.json (dependencies, scripts)
77+
- Build configuration files
78+
- Source code in src/ directory
79+
- GitHub Actions workflows
80+
81+
For each issue found, provide:
82+
1. Clear explanation of the problem
83+
2. Specific code suggestion with reasoning
84+
3. Potential impact on the documentation site
85+
86+
Ignore all .md and .mdx files - focus only on the technical infrastructure.
87+
EOF
88+
9089
- name: Read system prompt for append
9190
if: steps.check-files.outputs.skip_review != 'true'
9291
id: read-prompt
@@ -95,7 +94,7 @@ jobs:
9594
echo "system_content<<EOF" >> $GITHUB_OUTPUT
9695
echo "$SYSTEM_PROMPT" >> $GITHUB_OUTPUT
9796
echo "EOF" >> $GITHUB_OUTPUT
98-
97+
9998
- name: Run Claude Code Review
10099
if: steps.check-files.outputs.skip_review != 'true'
101100
id: claude-review
@@ -108,7 +107,7 @@ jobs:
108107
timeout_minutes: "15"
109108
max_turns: "20"
110109
model: "claude-sonnet-4-20250514"
111-
110+
112111
- name: Post review summary
113112
if: steps.claude-review.conclusion == 'success'
114113
uses: actions/github-script@v7
@@ -117,35 +116,33 @@ jobs:
117116
script: |
118117
const fs = require('fs');
119118
const executionFile = '${{ steps.claude-review.outputs.execution_file }}';
120-
119+
121120
if (!fs.existsSync(executionFile)) {
122121
console.log('No execution file found');
123122
return;
124123
}
125-
124+
126125
try {
127126
const executionLog = JSON.parse(fs.readFileSync(executionFile, 'utf8'));
128-
129-
// Get Claude's final response
127+
130128
let reviewContent = '';
131129
for (let i = executionLog.length - 1; i >= 0; i--) {
132130
if (executionLog[i].role === 'assistant' && executionLog[i].content) {
133131
reviewContent = executionLog[i].content;
134132
break;
135133
}
136134
}
137-
138-
const summary = "## 🤖 Claude Docusaurus Review\n\n" +
139-
reviewContent +
140-
"\n\n---\n<sub>Automated review by Claude Code</sub>";
141-
135+
136+
const summary = "## 🤖 Claude Docusaurus Review\n\n" +
137+
reviewContent +
138+
"\n\n---\n<sub>Automated review by Claude Code</sub>";
139+
142140
await github.rest.issues.createComment({
143141
issue_number: context.issue.number,
144142
owner: context.repo.owner,
145143
repo: context.repo.repo,
146144
body: summary
147145
});
148-
149146
} catch (error) {
150147
console.error('Error processing review:', error);
151148
}

0 commit comments

Comments
 (0)