Skip to content

Commit e91168d

Browse files
committed
updated dev agent
1 parent e93d8dd commit e91168d

File tree

1 file changed

+3
-157
lines changed

1 file changed

+3
-157
lines changed

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

Lines changed: 3 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ 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'
69+
cat > /tmp/review-prompt.txt << 'EOF'
7070
Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
7171
7272
Analyze changes to:
@@ -83,7 +83,7 @@ jobs:
8383
3. Potential impact on the documentation site
8484
8585
Ignore all .md and .mdx files - focus only on the technical infrastructure.
86-
REVIEW_PROMPT_EOF
86+
EOF
8787
8888
- name: Read system prompt for append
8989
if: steps.check-files.outputs.skip_review != 'true'
@@ -108,137 +108,6 @@ jobs:
108108
model: "claude-sonnet-4-20250514"
109109

110110
- name: Post review summary (bash)
111-
if: steps.claude-review.conclusion == 'success'
112-
env:
113-
EXECUTION_FILE: ${{ steps.claude-review.outputs.execution_file }}
114-
GH_TOKEN: ${{ secrets.NETWRIX_PROMPT_REPO_TOKEN }}
115-
PR_NUMBER: ${{ github.event.pull_request.number }}
116-
run: |
117-
if [ ! -f "$EXECUTION_FILE" ]; then
118-
echo "No execution file found"
119-
exit 0
120-
fi
121-
122-
# Extract the last assistant message using jq
123-
REVIEW_CONTENT=$(jq -r '.[] | select(.role == "assistant") | .content' "$EXECUTION_FILE" | tail -1)
124-
125-
if [ -z "$REVIEW_CONTENT" ]; then
126-
echo "No review content found"
127-
exit 0
128-
fi
129-
130-
# Create comment file with proper escaping
131-
cat > /tmp/comment.md << 'HEADER'
132-
## 🤖 Claude Docusaurus Rname: Claude Code Documentation Review
133-
on:
134-
pull_request:
135-
branches:
136-
- main
137-
- dev
138-
- fix/homepage-updates
139-
paths-ignore:
140-
- '**.md'
141-
- '**.mdx'
142-
jobs:
143-
claude-review:
144-
runs-on: ubuntu-latest
145-
146-
permissions:
147-
contents: read
148-
pull-requests: write
149-
150-
steps:
151-
- name: Checkout code
152-
uses: actions/checkout@v4
153-
with:
154-
fetch-depth: 2
155-
156-
- name: Fetch system prompt from private repo
157-
id: fetch-prompt
158-
env:
159-
GH_TOKEN: ${{ secrets.NETWRIX_PROMPT_REPO_TOKEN }}
160-
run: |
161-
echo "Fetching system prompt..."
162-
163-
RESPONSE=$(curl -s -w "\n%{http_code}" \
164-
-H "Authorization: token $GH_TOKEN" \
165-
-H "Accept: application/vnd.github.v3.raw" \
166-
https://api.github.com/repos/netwrix/action-agent-prompts/contents/docs-dev.md?ref=main)
167-
168-
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
169-
CONTENT=$(echo "$RESPONSE" | head -n-1)
170-
171-
if [ "$HTTP_CODE" != "200" ]; then
172-
echo "Failed to fetch system prompt (HTTP $HTTP_CODE)"
173-
exit 1
174-
fi
175-
176-
echo "$CONTENT" > /tmp/system-prompt.md
177-
echo "System prompt fetched successfully"
178-
179-
- name: Check for Docusaurus changes
180-
id: check-files
181-
run: |
182-
CHANGED_FILES=$(git diff --name-only HEAD~1)
183-
184-
DOCUSAURUS_FILES=$(echo "$CHANGED_FILES" | grep -E "(docusaurus\.config\.js|sidebars?\.js|babel\.config\.js|package\.json|\.github/|src/)" || true)
185-
186-
if [ -z "$DOCUSAURUS_FILES" ]; then
187-
echo "No Docusaurus infrastructure files changed. Skipping review."
188-
echo "skip_review=true" >> $GITHUB_OUTPUT
189-
else
190-
echo "skip_review=false" >> $GITHUB_OUTPUT
191-
echo "### 🎯 Docusaurus Files Changed" >> $GITHUB_STEP_SUMMARY
192-
echo '```' >> $GITHUB_STEP_SUMMARY
193-
echo "$DOCUSAURUS_FILES" >> $GITHUB_STEP_SUMMARY
194-
echo '```' >> $GITHUB_STEP_SUMMARY
195-
fi
196-
197-
- name: Create review prompt
198-
if: steps.check-files.outputs.skip_review != 'true'
199-
run: |
200-
cat > /tmp/review-prompt.txt << 'EOF'
201-
Review this pull request focusing exclusively on Docusaurus infrastructure and configuration files.
202-
203-
Analyze changes to:
204-
- docusaurus.config.js (site configuration, plugins, themes)
205-
- sidebars.js (navigation structure)
206-
- package.json (dependencies, scripts)
207-
- Build configuration files
208-
- Source code in src/ directory
209-
- GitHub Actions workflows
210-
211-
For each issue found, provide:
212-
1. Clear explanation of the problem
213-
2. Specific code suggestion with reasoning
214-
3. Potential impact on the documentation site
215-
216-
Ignore all .md and .mdx files - focus only on the technical infrastructure.
217-
EOF
218-
219-
- name: Read system prompt for append
220-
if: steps.check-files.outputs.skip_review != 'true'
221-
id: read-prompt
222-
run: |
223-
SYSTEM_PROMPT=$(cat /tmp/system-prompt.md)
224-
echo "system_content<<EOF" >> $GITHUB_OUTPUT
225-
echo "$SYSTEM_PROMPT" >> $GITHUB_OUTPUT
226-
echo "EOF" >> $GITHUB_OUTPUT
227-
228-
- name: Run Claude Code Review
229-
if: steps.check-files.outputs.skip_review != 'true'
230-
id: claude-review
231-
uses: anthropics/claude-code-base-action@beta
232-
with:
233-
prompt_file: /tmp/review-prompt.txt
234-
append_system_prompt: ${{ steps.read-prompt.outputs.system_content }}
235-
allowed_tools: "Read,Grep,Glob,LS"
236-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
237-
timeout_minutes: "15"
238-
max_turns: "20"
239-
model: "claude-sonnet-4-20250514"
240-
241-
- name: Post review summary (bash)
242111
if: steps.claude-review.conclusion == 'success'
243112
env:
244113
EXECUTION_FILE: ${{ steps.claude-review.outputs.execution_file }}
@@ -268,30 +137,7 @@ EOF
268137
269138
# Create comment file with proper escaping
270139
cat > /tmp/comment.md << 'HEADER'
271-
## 🤖 Claude Docusaurus Review
272-
273-
HEADER
274-
275-
# Append the review content
276-
echo "$REVIEW_CONTENT" >> /tmp/comment.md
277-
278-
# Add footer
279-
cat >> /tmp/comment.md << 'FOOTER'
280-
281-
---
282-
283-
<sub>Automated review by Claude Code</sub>
284-
FOOTER
285-
286-
# Post comment using GitHub API
287-
jq -n --arg body "$(cat /tmp/comment.md)" '{body: $body}' | \
288-
curl -X POST \
289-
-H "Authorization: token $GH_TOKEN" \
290-
-H "Accept: application/vnd.github.v3+json" \
291-
"https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" \
292-
-d @-
293-
294-
echo "Review posted successfully"eview
140+
## 🤖 Claude Docusaurus Review
295141
296142
HEADER
297143

0 commit comments

Comments
 (0)