Skip to content

ci(docs): add weekly docs update workflow#1365

Merged
Kitenite merged 4 commits into
mainfrom
kitenite/update-docs
Feb 10, 2026
Merged

ci(docs): add weekly docs update workflow#1365
Kitenite merged 4 commits into
mainfrom
kitenite/update-docs

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 10, 2026

Summary

  • Adds a weekly GitHub Actions workflow that uses Claude Code to review merged PRs and update documentation when user-facing features change
  • Mirrors the existing generate-changelog.yml pattern but targets apps/docs/ instead of the marketing changelog

Changes

  • .github/workflows/update-docs.yml — New workflow that runs every Wednesday at 9:00 AM UTC (or manually). Checks out the repo, runs Claude Code with the prompt, lints, commits, and opens a PR if docs were updated.
  • .github/prompts/update-docs.md — Prompt that instructs Claude to fetch recent merged PRs, cross-reference them against a mapping table of doc pages (e.g., terminal changes → terminal-integration.mdx), make targeted edits, and skip if nothing needs updating.

Test Plan

  • Trigger workflow manually via workflow_dispatch to verify end-to-end
  • Verify Claude Code correctly identifies PRs that need doc updates
  • Verify no PR is created when docs are already up to date

Summary by CodeRabbit

  • Chores
    • Added an automated docs-update workflow that runs weekly and can be triggered manually; it generates edits, lints, and opens a pull request with a review checklist when changes are detected.
    • Introduced a documentation update guide with step-by-step instructions and writing/style rules to streamline targeted doc edits.
    • Adjusted changelog workflow to use a deterministic branch update and include additional PR reviewers.

Adds a GitHub Actions workflow that runs weekly (Wednesdays) to review
merged PRs and update documentation when features change.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 10, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a new documentation-update prompt and a weekly GitHub Actions workflow to run Claude Code that scans merged PRs, applies targeted edits to MDX docs, and opens PRs when changes are detected; also tweaks branch naming and reviewer behavior in an existing changelog workflow.

Changes

Cohort / File(s) Summary
Docs prompt
​.github/prompts/update-docs.md
New seven-step prompt describing how Claude Code should identify merged PRs and make targeted edits or create MDX pages; includes change-type → doc-action mapping and style rules.
Update Docs workflow
​.github/workflows/update-docs.yml
New GitHub Actions workflow scheduled weekly and manually dispatchable; sets up Bun, installs Claude Code, runs the prompt, creates dated branch, lints, commits/pushes changes, and opens a PR with a checklist; uses secrets and conditional steps when no changes detected.
Changelog workflow tweak
​.github/workflows/generate-changelog.yml
Small adjustments: branch creation now uses run ID and forces branch creation/update (-B), and the PR creation step adds reviewers. Pay attention to branch naming and PR reviewer flags.

Sequence Diagram

sequenceDiagram
    participant Scheduler as GitHub Scheduler
    participant Runner as Actions Runner
    participant Repo as Repository
    participant Claude as Claude Code
    participant GHAPI as GitHub API

    Scheduler->>Runner: Trigger workflow (weekly / manual)
    Runner->>Repo: Checkout repository
    Runner->>Runner: Setup Bun & install deps
    Runner->>Runner: Install Claude Code
    Runner->>Runner: Create dated branch
    Runner->>Claude: Run prompt (`.github/prompts/update-docs.md`)
    Claude->>Repo: Read recent merged PRs and docs (MDX)
    Claude->>Repo: Apply targeted doc edits or add pages
    Runner->>Repo: Detect changes
    alt Changes detected
        Runner->>Runner: Run lint fix
        Runner->>Repo: Commit & push to branch
        Runner->>GHAPI: Create Pull Request (with reviewers & checklist)
    else No changes
        Runner->>Scheduler: Complete without PR
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through commits in the night,
Scanned merged PRs by moonlight bright,
I nudged the docs with gentle cheer,
A weekly bloom of notes appears,
Branches born and PRs take flight ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci(docs): add weekly docs update workflow' is concise, specific, and accurately summarizes the main change—introducing a new GitHub Actions workflow for automated documentation updates.
Description check ✅ Passed The PR description is well-structured with a clear summary, detailed breakdown of changes, and a test plan. It covers the key aspects but lacks explicit sections matching the template structure (Description, Related Issues, Type of Change, Testing, Screenshots, Additional Notes).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/update-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/update-docs.yml:
- Around line 40-44: The branch creation step uses BRANCH_NAME and runs git
checkout -b which will fail on same-day re-runs if the branch already exists;
change the logic to make BRANCH_NAME include a unique suffix (e.g., append
GITHUB_RUN_ID or timestamp) or replace git checkout -b with git checkout -B
"$BRANCH_NAME" (or both) so the branch is unique or force-resettable; update the
BRANCH_NAME assignment and the git checkout invocation accordingly to prevent
collisions.
🧹 Nitpick comments (4)
.github/prompts/update-docs.md (1)

11-13: Reading every doc page upfront may be unnecessarily expensive.

Line 13 instructs Claude to "read each existing doc page" before determining which PRs affect docs. Consider reading meta.json first (already step 2a), then only reading individual pages once a PR is matched to them via the mapping table. This reduces token usage and keeps Claude focused.

.github/workflows/update-docs.yml (3)

66-73: git add -A stages everything — consider scoping to docs only.

If Claude Code or the lint step inadvertently modifies files outside apps/docs/ (or creates temp files), git add -A will include them in the commit. Scoping the add to the intended directories reduces the blast radius.

Proposed fix
-          git add -A
+          git add apps/docs/

If meta.json or other config files outside apps/docs/ may also be legitimately updated, add those paths explicitly.


18-21: fetch-depth: 0 (full clone) is likely unnecessary.

The workflow doesn't use git history — it creates a new branch, makes changes, and pushes. A shallow clone (default fetch-depth: 1) would be faster. The gh pr list command queries the API, not local git history.

Proposed fix
      - name: Check out code
        uses: actions/checkout@v4
-        with:
-          fetch-depth: 0

37-38: Pin @anthropic-ai/claude-code to a specific version.

Installing without a version tag means the workflow silently picks up whatever latest is at run time. A breaking change in a new Claude Code release could break the workflow without any change on your side.

Proposed fix
      - name: Install Claude Code
-        run: npm install -g `@anthropic-ai/claude-code`
+        run: npm install -g `@anthropic-ai/claude-code`@2.1.37

Replace 2.1.37 with whatever the current version is.

Comment thread .github/workflows/update-docs.yml
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 10, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Fly.io Streams (Fly.io) Failed to deploy
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant