Skip to content

feat: add Claude documentation updater workflow#1130

Merged
Crunchyman-ralph merged 1 commit intonextfrom
chore/add.automatic.claude.docs.updater.ci
Aug 13, 2025
Merged

feat: add Claude documentation updater workflow#1130
Crunchyman-ralph merged 1 commit intonextfrom
chore/add.automatic.claude.docs.updater.ci

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Aug 13, 2025

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • Documentation
    • Documentation will now be automatically reviewed and updated after changes land, keeping examples, changelog, and navigation current.
    • Auto-generated documentation PRs include clear summaries and labels for easier review.
  • Chores
    • Introduced automation to detect user-facing changes and propose corresponding documentation updates, reducing stale or missing docs.

This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.
@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2025

⚠️ No Changeset found

Latest commit: 43d8ac8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Introduces a new GitHub Actions workflow that, on pushes to the next branch (with path filters), analyzes repo changes using anthropics/claude-code-action@beta to determine and apply documentation updates under apps/docs/, then auto-commits, pushes a branch, and opens a PR to next with labels and a generated summary.

Changes

Cohort / File(s) Summary of changes
CI/CD workflows
.github/workflows/claude-docs-updater.yml
Added workflow to detect code changes, generate docs updates via Claude Code, commit to a timestamped branch, push, and open a PR to next with labels and contextual PR body. Triggers on push to next excluding docs, markdown, and workflows paths.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub
  participant WF as Docs Updater Workflow
  participant CC as Claude Code Action
  participant Git as Repo/Branch
  participant PR as Pull Requests

  Dev->>GH: Push to branch "next"
  GH-->>WF: Trigger (path filters applied)
  WF->>Git: Checkout (fetch-depth: 2)
  WF->>WF: Collect changed files, commit msg, diff summary
  WF->>Git: Create docs-update branch (timestamped)
  WF->>CC: Run analysis & propose docs changes under apps/docs/
  CC-->>WF: Suggested edits (or none)
  alt Changes detected
    WF->>Git: Commit and push docs updates
    WF->>PR: Create PR to "next" with labels and summary
  else No changes
    WF->>WF: Skip PR creation
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Suggested reviewers

  • eyaltoledano
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add.automatic.claude.docs.updater.ci

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Crunchyman-ralph Crunchyman-ralph merged commit f469515 into next Aug 13, 2025
4 of 5 checks passed
@Crunchyman-ralph Crunchyman-ralph deleted the chore/add.automatic.claude.docs.updater.ci branch August 13, 2025 13:10
Copy link
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: 8

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3ed4d7 and 43d8ac8.

📒 Files selected for processing (1)
  • .github/workflows/claude-docs-updater.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-11T12:30:23.843Z
Learning: Import Task Master's development workflow commands and guidelines; treat the contents of ./.taskmaster/CLAUDE.md as if included in the main CLAUDE.md
📚 Learning: 2025-08-11T12:30:23.843Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-11T12:30:23.843Z
Learning: Import Task Master's development workflow commands and guidelines; treat the contents of ./.taskmaster/CLAUDE.md as if included in the main CLAUDE.md

Applied to files:

  • .github/workflows/claude-docs-updater.yml
🪛 YAMLlint (1.37.1)
.github/workflows/claude-docs-updater.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)


[error] 70-70: trailing spaces

(trailing-spaces)


[error] 75-75: trailing spaces

(trailing-spaces)


[error] 78-78: trailing spaces

(trailing-spaces)


[error] 89-89: trailing spaces

(trailing-spaces)


[error] 97-97: trailing spaces

(trailing-spaces)


[error] 113-113: trailing spaces

(trailing-spaces)


[error] 115-115: trailing spaces

(trailing-spaces)


[error] 125-125: trailing spaces

(trailing-spaces)


[error] 136-136: trailing spaces

(trailing-spaces)


[error] 154-154: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
.github/workflows/claude-docs-updater.yml (2)

5-11: paths-ignore policy looks correct for avoiding self-trigger loops

Ignoring apps/docs/*, .md, and .github/workflows/ ensures the workflow doesn't re-trigger on its own PRs or doc-only changes. Good choice.


56-58: Pin the third-party action to a specific commit SHA
Pinning anthropics/claude-code-action@beta to a fixed commit prevents unexpected upstream changes from impacting your workflow.

• File: .github/workflows/claude-docs-updater.yml (lines 56–58)
• Current:

      - name: Run Claude Code to Update Documentation
        uses: anthropics/claude-code-action@beta
        with:

• Suggested change:

-        uses: anthropics/claude-code-action@beta
+        # Pin to a specific, vetted commit SHA
+        uses: anthropics/claude-code-action@<COMMIT_SHA>

Please verify and replace <COMMIT_SHA> with the latest vetted SHA for anthropics/claude-code-action.

jobs:
update-docs:
# Only run if changes were merged (not direct pushes from bots)
if: github.event.pusher.name != 'github-actions[bot]' && github.event.pusher.name != 'dependabot[bot]'
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use a more reliable actor guard to prevent bot-loops

Checking github.event.pusher.name is brittle. Prefer github.actor and/or contains checks for bot accounts. This avoids missing cases (e.g., web-flow, auto-merge).

-    if: github.event.pusher.name != 'github-actions[bot]' && github.event.pusher.name != 'dependabot[bot]'
+    # Skip runs initiated by common bot accounts to prevent loops
+    if: ${{ github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]' }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: github.event.pusher.name != 'github-actions[bot]' && github.event.pusher.name != 'dependabot[bot]'
# Skip runs initiated by common bot accounts to prevent loops
if: ${{ github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]' }}
🤖 Prompt for AI Agents
In .github/workflows/claude-docs-updater.yml around line 15, replace the brittle
github.event.pusher.name check with a guard using github.actor and a contains
check for bot accounts; e.g., test that github.actor is not one of known
automation actors and does not contain "bot" (for example: github.actor !=
'github-actions[bot]' && github.actor != 'dependabot[bot]' &&
!contains(github.actor, 'bot')), or otherwise use a negative contains check to
exclude actors with "bot" in their name—update the if condition accordingly to
reliably prevent bot-triggered loops.

Comment on lines +17 to +21
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Minimize GHA permissions (drop unused scopes)

id-token and issues are not used. Reduce attack surface by granting only what is necessary.

     permissions:
-      contents: write
-      pull-requests: write
-      issues: write
-      id-token: write
+      contents: write
+      pull-requests: write
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
permissions:
contents: write
pull-requests: write
🤖 Prompt for AI Agents
.github/workflows/claude-docs-updater.yml around lines 17 to 21: the workflow
grants unnecessary permissions (id-token and issues); remove those scopes from
the permissions block so only contents: write and pull-requests: write remain
(or any other minimal scopes actually required by the job), ensuring you leave
no unused permissions in the file.

Comment on lines +23 to +27
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # Need previous commit for comparison

Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optional: make the push-diff resilient without relying on fetch-depth

With the switch to github.event.before/sha, fetch-depth: 2 is sufficient. If you ever need to handle edge cases (e.g., forced pushes or rewritten histories), consider fetch-depth: 0.

-          fetch-depth: 2  # Need previous commit for comparison
+          fetch-depth: 2  # Sufficient when using ${{ github.event.before }}..${{ github.sha }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # Need previous commit for comparison
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # Sufficient when using ${{ github.event.before }}..${{ github.sha }}
🤖 Prompt for AI Agents
.github/workflows/claude-docs-updater.yml lines 23-27: the workflow currently
sets fetch-depth: 2 which works for most comparisons but can fail on forced
pushes or rewritten histories; update the checkout step to use fetch-depth: 0 to
fetch full history (or implement a fallback that runs a full git fetch when
needed) so that comparisons using github.event.before/sha are resilient to edge
cases.

Comment on lines +28 to +47
- name: Get changed files
id: changed-files
run: |
echo "Changed files in this push:"
git diff --name-only HEAD^ HEAD | tee changed_files.txt

# Store changed files for Claude to analyze
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
git diff --name-only HEAD^ HEAD >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Get the commit message and changes summary
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
git log -1 --pretty=%B >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Get diff for documentation context
echo "commit_diff<<EOF" >> $GITHUB_OUTPUT
git diff HEAD^ HEAD --stat >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Diff only the pushed range (support multi-commit pushes and merges)

Using HEAD^ HEAD captures only the last commit and can break on non-linear histories. Use GitHub’s before/after SHAs. Also expose a commits list for the prompt.

       - name: Get changed files
         id: changed-files
         run: |
-          echo "Changed files in this push:"
-          git diff --name-only HEAD^ HEAD | tee changed_files.txt
-          
-          # Store changed files for Claude to analyze
-          echo "changed_files<<EOF" >> $GITHUB_OUTPUT
-          git diff --name-only HEAD^ HEAD >> $GITHUB_OUTPUT
-          echo "EOF" >> $GITHUB_OUTPUT
-          
-          # Get the commit message and changes summary
-          echo "commit_message<<EOF" >> $GITHUB_OUTPUT
-          git log -1 --pretty=%B >> $GITHUB_OUTPUT
-          echo "EOF" >> $GITHUB_OUTPUT
-          
-          # Get diff for documentation context
-          echo "commit_diff<<EOF" >> $GITHUB_OUTPUT
-          git diff HEAD^ HEAD --stat >> $GITHUB_OUTPUT
-          echo "EOF" >> $GITHUB_OUTPUT
+          BEFORE="${{ github.event.before }}"
+          AFTER="${{ github.sha }}"
+
+          echo "Changed files in this push range ($BEFORE..$AFTER):"
+          git diff --name-only "$BEFORE" "$AFTER" | tee /dev/stderr
+
+          # Store changed files for Claude to analyze
+          {
+            echo "changed_files<<EOF"
+            git diff --name-only "$BEFORE" "$AFTER"
+            echo "EOF"
+          } >> "$GITHUB_OUTPUT"
+
+          # Get the commit messages in range (subject lines) and full body of the last commit
+          {
+            echo "commit_message<<EOF"
+            git log -1 --pretty=%B "$AFTER"
+            echo "EOF"
+          } >> "$GITHUB_OUTPUT"
+          {
+            echo "commit_list<<EOF"
+            git log --format='- %h %s' "$BEFORE..$AFTER"
+            echo "EOF"
+          } >> "$GITHUB_OUTPUT"
+
+          # Get diff summary for context
+          {
+            echo "commit_diff<<EOF"
+            git diff --stat "$BEFORE" "$AFTER"
+            echo "EOF"
+          } >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Get changed files
id: changed-files
run: |
echo "Changed files in this push:"
git diff --name-only HEAD^ HEAD | tee changed_files.txt
# Store changed files for Claude to analyze
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
git diff --name-only HEAD^ HEAD >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Get the commit message and changes summary
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
git log -1 --pretty=%B >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Get diff for documentation context
echo "commit_diff<<EOF" >> $GITHUB_OUTPUT
git diff HEAD^ HEAD --stat >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Get changed files
id: changed-files
run: |
BEFORE="${{ github.event.before }}"
AFTER="${{ github.sha }}"
echo "Changed files in this push range ($BEFORE..$AFTER):"
git diff --name-only "$BEFORE" "$AFTER" | tee /dev/stderr
# Store changed files for Claude to analyze
{
echo "changed_files<<EOF"
git diff --name-only "$BEFORE" "$AFTER"
echo "EOF"
} >> "$GITHUB_OUTPUT"
# Get the commit messages in range (subject lines) and full body of the last commit
{
echo "commit_message<<EOF"
git log -1 --pretty=%B "$AFTER"
echo "EOF"
} >> "$GITHUB_OUTPUT"
{
echo "commit_list<<EOF"
git log --format='- %h %s' "$BEFORE..$AFTER"
echo "EOF"
} >> "$GITHUB_OUTPUT"
# Get diff summary for context
{
echo "commit_diff<<EOF"
git diff --stat "$BEFORE" "$AFTER"
echo "EOF"
} >> "$GITHUB_OUTPUT"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
.github/workflows/claude-docs-updater.yml around lines 28-47: the step uses git
diff HEAD^ HEAD which only captures the last commit and fails for multi-commit
pushes or non-linear histories; replace the HEAD^ HEAD range with
GitHub-provided before/after SHAs and add a commits list: use the workflow
expression ${ github.event.before } and ${ github.event.after } (e.g. git diff
--name-only ${{ github.event.before }} ${{ github.event.after }}) for changed
files and diffs, and add a command to list commits in the push (e.g. git
--no-pager log --pretty=format:'%H %s' ${{ github.event.before }}..${{
github.event.after }} ) and write that output to the $GITHUB_OUTPUT block so
Claude receives the full commit list and diff for multi-commit or merge pushes;
also ensure actions/checkout fetches enough history (fetch-depth: 0) so those
ranges are available.

run: |
echo "Changed files in this push:"
git diff --name-only HEAD^ HEAD | tee changed_files.txt

Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Fix YAML lint issues: trailing spaces and missing EOF newline

Remove trailing spaces on the noted lines and ensure the file ends with a newline. No functional change, but keeps CI/tools happy.

Also applies to: 38-38, 43-43, 70-70, 75-75, 78-78, 89-89, 97-97, 113-113, 115-115, 125-125, 136-136, 154-154

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 33-33: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
.github/workflows/claude-docs-updater.yml lines 33, 38, 43, 70, 75, 78, 89, 97,
113, 115, 125, 136, 154: several lines contain trailing spaces and the file is
missing a final newline; remove the trailing whitespace characters from each
listed line and ensure the file ends with a single newline character (add an EOF
newline if missing) so the YAML passes linting and CI checks.

Comment on lines +69 to +99
You are a documentation specialist. Analyze the recent changes pushed to the 'next' branch and update the documentation accordingly.

Recent changes:
- Commit: ${{ steps.changed-files.outputs.commit_message }}
- Changed files:
${{ steps.changed-files.outputs.changed_files }}

- Changes summary:
${{ steps.changed-files.outputs.commit_diff }}

Your task:
1. Analyze the changes to understand what functionality was added, modified, or removed
2. Check if these changes require documentation updates in apps/docs/
3. If documentation updates are needed:
- Update relevant documentation files in apps/docs/
- Ensure examples are updated if APIs changed
- Update any configuration documentation if config options changed
- Add new documentation pages if new features were added
- Update the changelog or release notes if applicable
4. If no documentation updates are needed, skip creating changes

Guidelines:
- Focus only on user-facing changes that need documentation
- Keep documentation clear, concise, and helpful
- Include code examples where appropriate
- Maintain consistent documentation style with existing docs
- Don't document internal implementation details unless they affect users
- Update navigation/menu files if new pages are added

Only make changes if the documentation truly needs updating based on the code changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Tighten the prompt: enforce scope to apps/docs and align with Task Master CLAUDE guidelines

Prevent accidental non-doc edits by instructing Claude to only modify files under apps/docs/. Also, per our learnings, import guidelines from CLAUDE.md and ./.taskmaster/CLAUDE.md.

           prompt: |
             You are a documentation specialist. Analyze the recent changes pushed to the 'next' branch and update the documentation accordingly.
+            Important:
+            - Only modify files under apps/docs/ (do not change any files outside this directory).
+            - Follow the repository's documentation style guide and the instructions in CLAUDE.md and ./.taskmaster/CLAUDE.md.

             Recent changes:
             - Commit: ${{ steps.changed-files.outputs.commit_message }}
+            - Commits in push:
+            ${{ steps.changed-files.outputs.commit_list }}
             - Changed files:
             ${{ steps.changed-files.outputs.changed_files }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
You are a documentation specialist. Analyze the recent changes pushed to the 'next' branch and update the documentation accordingly.
Recent changes:
- Commit: ${{ steps.changed-files.outputs.commit_message }}
- Changed files:
${{ steps.changed-files.outputs.changed_files }}
- Changes summary:
${{ steps.changed-files.outputs.commit_diff }}
Your task:
1. Analyze the changes to understand what functionality was added, modified, or removed
2. Check if these changes require documentation updates in apps/docs/
3. If documentation updates are needed:
- Update relevant documentation files in apps/docs/
- Ensure examples are updated if APIs changed
- Update any configuration documentation if config options changed
- Add new documentation pages if new features were added
- Update the changelog or release notes if applicable
4. If no documentation updates are needed, skip creating changes
Guidelines:
- Focus only on user-facing changes that need documentation
- Keep documentation clear, concise, and helpful
- Include code examples where appropriate
- Maintain consistent documentation style with existing docs
- Don't document internal implementation details unless they affect users
- Update navigation/menu files if new pages are added
Only make changes if the documentation truly needs updating based on the code changes.
prompt: |
You are a documentation specialist. Analyze the recent changes pushed to the 'next' branch and update the documentation accordingly.
Important:
- Only modify files under apps/docs/ (do not change any files outside this directory).
- Follow the repository's documentation style guide and the instructions in CLAUDE.md and ./.taskmaster/CLAUDE.md.
Recent changes:
- Commit: ${{ steps.changed-files.outputs.commit_message }}
- Commits in push:
${{ steps.changed-files.outputs.commit_list }}
- Changed files:
${{ steps.changed-files.outputs.changed_files }}
- Changes summary:
${{ steps.changed-files.outputs.commit_diff }}
Your task:
1. Analyze the changes to understand what functionality was added, modified, or removed
2. Check if these changes require documentation updates in apps/docs/
3. If documentation updates are needed:
- Update relevant documentation files in apps/docs/
- Ensure examples are updated if APIs changed
- Update any configuration documentation if config options changed
- Add new documentation pages if new features were added
- Update the changelog or release notes if applicable
4. If no documentation updates are needed, skip creating changes
Guidelines:
- Focus only on user-facing changes that need documentation
- Keep documentation clear, concise, and helpful
- Include code examples where appropriate
- Maintain consistent documentation style with existing docs
- Don't document internal implementation details unless they affect users
- Update navigation/menu files if new pages are added
Only make changes if the documentation truly needs updating based on the code changes.
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 70-70: trailing spaces

(trailing-spaces)


[error] 75-75: trailing spaces

(trailing-spaces)


[error] 78-78: trailing spaces

(trailing-spaces)


[error] 89-89: trailing spaces

(trailing-spaces)


[error] 97-97: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/claude-docs-updater.yml around lines 69 to 99, the task
prompt is too broad and may allow non-documentation edits; tighten it to
explicitly restrict modifications to files under apps/docs/ and to refuse any
changes outside that directory, and incorporate import/guideline references by
instructing Claude to follow the CLAUDE.md and ./.taskmaster/CLAUDE.md rules for
content style and import guidelines; update the prompt text to (1) state "Only
modify files under apps/docs/ — do not edit any other paths", (2) require
following CLAUDE.md and ./.taskmaster/CLAUDE.md for examples, formatting and
import rules, and (3) include an explicit step to skip creating changes if none
are needed, ensuring the runner will not produce non-doc commits.

Comment on lines +100 to +117
- name: Check if changes were made
id: check-changes
run: |
if git diff --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
git add -A
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "docs: auto-update documentation based on changes in next branch

This PR was automatically generated to update documentation based on recent changes.

Original commit: ${{ steps.changed-files.outputs.commit_message }}

Co-authored-by: Claude <claude-assistant@anthropic.com>"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Commit only docs changes; use a here-doc for a safe, multi-line commit message

Current git add -A might commit unintended non-doc files. Also, embedding commit_message directly in double quotes risks breaking on quotes/newlines. Restrict to apps/docs and use -F with a here-doc.

       - name: Check if changes were made
         id: check-changes
         run: |
-          if git diff --quiet; then
+          # Only consider changes under apps/docs
+          if git diff --quiet -- apps/docs; then
             echo "has_changes=false" >> $GITHUB_OUTPUT
           else
             echo "has_changes=true" >> $GITHUB_OUTPUT
-            git add -A
+            git add -A apps/docs
             git config --local user.email "github-actions[bot]@users.noreply.github.com"
             git config --local user.name "github-actions[bot]"
-            git commit -m "docs: auto-update documentation based on changes in next branch
-
-            This PR was automatically generated to update documentation based on recent changes.
-            
-            Original commit: ${{ steps.changed-files.outputs.commit_message }}
-            
-            Co-authored-by: Claude <claude-assistant@anthropic.com>"
+            git commit -F- <<'MSG'
+            docs: auto-update documentation based on changes in next branch
+
+            This PR was automatically generated to update documentation based on recent changes.
+
+            Original commit message:
+            ---
+            ${{ steps.changed-files.outputs.commit_message }}
+            ---
+
+            Co-authored-by: Claude <claude-assistant@anthropic.com>
+            MSG
           fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Check if changes were made
id: check-changes
run: |
if git diff --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
git add -A
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "docs: auto-update documentation based on changes in next branch
This PR was automatically generated to update documentation based on recent changes.
Original commit: ${{ steps.changed-files.outputs.commit_message }}
Co-authored-by: Claude <claude-assistant@anthropic.com>"
fi
- name: Check if changes were made
id: check-changes
run: |
# Only consider changes under apps/docs
if git diff --quiet -- apps/docs; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
git add -A apps/docs
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -F- <<'MSG'
docs: auto-update documentation based on changes in next branch
This PR was automatically generated to update documentation based on recent changes.
Original commit message:
---
${{ steps.changed-files.outputs.commit_message }}
---
Co-authored-by: Claude <claude-assistant@anthropic.com>
MSG
fi
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 113-113: trailing spaces

(trailing-spaces)


[error] 115-115: trailing spaces

(trailing-spaces)

Comment on lines +119 to +154
- name: Push changes and create PR
if: steps.check-changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin ${{ steps.create-branch.outputs.branch_name }}

# Create PR using GitHub CLI
gh pr create \
--title "docs: update documentation for recent changes" \
--body "## 📚 Documentation Update

This PR automatically updates documentation based on recent changes merged to the \`next\` branch.

### Original Changes
**Commit:** ${{ github.sha }}
**Message:** ${{ steps.changed-files.outputs.commit_message }}

### Changed Files in Original Commit
\`\`\`
${{ steps.changed-files.outputs.changed_files }}
\`\`\`

### Documentation Updates
This PR includes documentation updates to reflect the changes above. Please review to ensure:
- [ ] Documentation accurately reflects the changes
- [ ] Examples are correct and working
- [ ] No important details are missing
- [ ] Style is consistent with existing documentation

---
*This PR was automatically generated by Claude Code GitHub Action*" \
--base next \
--head ${{ steps.create-branch.outputs.branch_name }} \
--label "documentation" \
--label "automated" No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optionally add concurrency and auto-assign labels/reviewers directly on PR creation

The PR creation looks good. Consider adding a concurrency group to avoid overlapping runs on rapid pushes and optionally auto-assign reviewers/labels via repo defaults.

Additional snippet to add near the job definition (outside this range):

# Prevent overlapping runs on the same branch
concurrency:
  group: claude-docs-updater-next
  cancel-in-progress: true
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 125-125: trailing spaces

(trailing-spaces)


[error] 136-136: trailing spaces

(trailing-spaces)


[error] 154-154: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
In .github/workflows/claude-docs-updater.yml around lines 119 to 154, add a
concurrency policy at the workflow or job level to prevent overlapping runs
(e.g., set concurrency.group to a stable name like "claude-docs-updater-next"
and cancel-in-progress: true) and optionally update the PR creation step to
auto-assign reviewers or assignees by adding the appropriate gh pr create flags
(e.g., --reviewer and/or --assignee) or rely on repository default
reviewers/labels so concurrent pushes don’t produce conflicting PRs and
reviewers/labels are applied on creation.

stephanschielke pushed a commit to stephanschielke/cursor-task-master that referenced this pull request Aug 22, 2025
This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.
stephanschielke pushed a commit to stephanschielke/cursor-task-master that referenced this pull request Aug 22, 2025
This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.
@coderabbitai coderabbitai bot mentioned this pull request Aug 22, 2025
16 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 8, 2025
16 tasks
davidgilady pushed a commit to davidgilady/claude-task-master that referenced this pull request Sep 23, 2025
This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
This commit introduces a new GitHub Actions workflow that automatically updates documentation based on changes pushed to the 'next' branch. The workflow checks for modified files, creates a new branch for documentation updates, and utilizes the Claude Code Action to analyze changes and suggest necessary documentation revisions. If updates are made, a pull request is created for review.
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