feat: add Claude documentation updater workflow#1130
Conversation
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.
|
WalkthroughIntroduces 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 8
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 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 loopsIgnoring 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
Pinninganthropics/claude-code-action@betato 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 foranthropics/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]' |
There was a problem hiding this comment.
🛠️ 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.
| 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.
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| id-token: write |
There was a problem hiding this comment.
🛠️ 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.
| 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.
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 # Need previous commit for comparison | ||
|
|
There was a problem hiding this comment.
🧹 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.
| - 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.
| - 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 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
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.
| - 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 | ||
|
|
There was a problem hiding this comment.
🧹 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.
| 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. | ||
|
|
There was a problem hiding this comment.
🛠️ 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.
| 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.
| - 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 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
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.
| - 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)
| - 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 |
There was a problem hiding this comment.
🧹 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.
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.
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.
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.
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.
What type of PR is this?
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 stepsExpected result:
Contributor Checklist
npm run changesetnpm testnpm run format-check(ornpm run formatto fix)Changelog Entry
For Maintainers
Summary by CodeRabbit