Skip to content

Commit a447108

Browse files
authored
Create ai-docs-pr.yml (#985)
testing ai workflow
1 parent 3ae4df6 commit a447108

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ai-docs-pr.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# .github/workflows/doc-pr-from-webhook.yml
2+
name: Create Docs PR from Webhook Prompt
3+
4+
on:
5+
repository_dispatch:
6+
types: [doc_update]
7+
8+
jobs:
9+
generate-docs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v3
15+
16+
- name: Claude Code
17+
uses: anthropics/claude-code-action@beta
18+
with:
19+
prompt: "Review the /docs folder structure and file content, and propose changes (if applicable and not already addressed in documentation) based on this prompt: ${{ github.event.client_payload.prompt }}"
20+
anthropic_api_key: "${{ secrets.CLAUDE_API_KEY }}"
21+
output-dir: "output"
22+
23+
- name: Create Branch and Commit
24+
run: |
25+
branch="doc-update-${{ github.run_id }}"
26+
git config user.name "github-actions"
27+
git config user.email "[email protected]"
28+
git checkout -b "$branch"
29+
cp -r output/* .
30+
git add .
31+
git commit -m "Update docs via Claude"
32+
git push origin "$branch"
33+
34+
- name: Create Pull Request
35+
run: gh pr create --base main --head "doc-update-${{ github.run_id }}" --title "Automated Doc Update" --body "Prompt:${{github.event.client_payload.prompt}}"
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)