ci: add Claude-powered documentation auto-update workflow
This commit is contained in:
parent
d65031bbeb
commit
3cd65587c5
1 changed files with 67 additions and 0 deletions
67
.github/workflows/update-docs.yml
vendored
Normal file
67
.github/workflows/update-docs.yml
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
name: Update Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'packages/**'
|
||||
- 'apps/**'
|
||||
- 'templates/**'
|
||||
- '!**/*.md'
|
||||
|
||||
jobs:
|
||||
update-docs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Get changed files
|
||||
id: changed
|
||||
run: |
|
||||
echo "files=$(git diff --name-only HEAD~1 HEAD | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Run Claude Code
|
||||
uses: anthropics/claude-code-action@beta
|
||||
with:
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
prompt: |
|
||||
Analyze the recent code changes and update any relevant documentation.
|
||||
|
||||
Changed files: ${{ steps.changed.outputs.files }}
|
||||
|
||||
Tasks:
|
||||
1. Read the changed files to understand what was modified
|
||||
2. Check if any README files, doc pages, or code comments need updating
|
||||
3. Update documentation to reflect the code changes
|
||||
4. Keep docs concise and accurate
|
||||
|
||||
Focus on:
|
||||
- API changes that affect usage examples
|
||||
- New features that need documentation
|
||||
- Changed behavior that affects existing docs
|
||||
- Executor template documentation (templates/vercel-executor/README.md)
|
||||
- Package READMEs in packages/
|
||||
|
||||
Only make changes if documentation is actually out of sync with code.
|
||||
If no documentation updates are needed, do nothing.
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'docs: auto-update documentation based on code changes'
|
||||
title: 'docs: Auto-update documentation'
|
||||
body: |
|
||||
This PR was automatically generated by Claude Code to update documentation based on recent code changes.
|
||||
|
||||
Please review the changes before merging.
|
||||
branch: auto-docs-update
|
||||
delete-branch: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue