summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/docs-update.yml
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-12-21 21:52:44 -0600
committerAiden Cline <[email protected]>2025-12-21 21:52:44 -0600
commitc1894b4e3ddb5e21ad9677f6f535e8994f260f28 (patch)
tree424fff24882b0ec5f97f6fcbf3257c5730293360 /.github/workflows/docs-update.yml
parent2062247e72f738597a1c55988a98e5e2df944b6a (diff)
downloadopencode-c1894b4e3ddb5e21ad9677f6f535e8994f260f28.tar.gz
opencode-c1894b4e3ddb5e21ad9677f6f535e8994f260f28.zip
ci: add automatic doc update workflow
Diffstat (limited to '.github/workflows/docs-update.yml')
-rw-r--r--.github/workflows/docs-update.yml63
1 files changed, 63 insertions, 0 deletions
diff --git a/.github/workflows/docs-update.yml b/.github/workflows/docs-update.yml
new file mode 100644
index 000000000..9b93ba803
--- /dev/null
+++ b/.github/workflows/docs-update.yml
@@ -0,0 +1,63 @@
+name: Docs Update
+
+on:
+ schedule:
+ # Run every 4 hours
+ - cron: "0 */4 * * *"
+ workflow_dispatch: # Allow manual trigger for testing
+
+jobs:
+ update-docs:
+ runs-on: ubuntu-latest
+ permissions:
+ id-token: write
+ contents: write
+ pull-requests: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Fetch full history to access commits
+
+ - name: Get recent commits
+ id: commits
+ run: |
+ COMMITS=$(git log --since="4 hours ago" --pretty=format:"- %h %s" 2>/dev/null || echo "")
+ if [ -z "$COMMITS" ]; then
+ echo "No commits in the last 4 hours"
+ echo "has_commits=false" >> $GITHUB_OUTPUT
+ else
+ echo "has_commits=true" >> $GITHUB_OUTPUT
+ {
+ echo "list<<EOF"
+ echo "$COMMITS"
+ echo "EOF"
+ } >> $GITHUB_OUTPUT
+ fi
+
+ - name: Run opencode
+ if: steps.commits.outputs.has_commits == 'true'
+ uses: sst/opencode/github@latest
+ env:
+ OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
+ with:
+ model: opencode/gpt-5.2
+ agent: docs
+ prompt: |
+ Review the following commits from the last 4 hours and identify any new features that may need documentation.
+
+ <recent_commits>
+ ${{ steps.commits.outputs.list }}
+ </recent_commits>
+
+ Steps:
+ 1. For each commit that looks like a new feature or significant change:
+ - Read the changed files to understand what was added
+ - Check if the feature is already documented in packages/docs/
+ 2. If you find undocumented features:
+ - Update the relevant documentation files in packages/docs/
+ - Follow the existing documentation style and structure
+ - Make sure to document the feature clearly with examples where appropriate
+ 3. If all new features are already documented, report that no updates are needed
+
+ Focus on user-facing features and API changes. Skip internal refactors, bug fixes, and test updates unless they affect user-facing behavior.