Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Claude Code Review
name: claude-code-review

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Claude Code
name: claude

on:
issue_comment:
Expand Down
82 changes: 37 additions & 45 deletions .github/workflows/docs-sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Documentation Sync
name: doc-sync

on:
pull_request:
Expand All @@ -7,13 +7,15 @@ on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Commit SHA to analyze for documentation updates'
description: "Commit SHA to analyze for documentation updates"
required: true
type: string

jobs:
docs-sync:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
if:
github.event.pull_request.merged == true || github.event_name ==
'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -28,17 +30,16 @@ jobs:

- name: Get changed files
id: changed-files
env:
COMMIT_SHA: ${{ github.event.inputs.commit_sha }}
run: |
set -e
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# Get changed files for the specified commit
git fetch origin
CHANGED_FILES=$(git diff --name-only "$COMMIT_SHA"~1 "$COMMIT_SHA")
CHANGED_FILES=$(git diff --name-only ${{ github.event.inputs.commit_sha }}~1 ${{ github.event.inputs.commit_sha }})
else
# Get list of changed files in the merged PR
git fetch origin main
CHANGED_FILES=$(git diff --name-only origin/main~1 origin/main)
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.merge_commit_sha }})
fi
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
done <<< "${{ steps.changed-files.outputs.changed_files }}"

echo "needs_update=$NEEDS_DOCS_UPDATE" >> $GITHUB_OUTPUT
echo "Files that may need docs updates: ${{ steps.changed-files.outputs.changed_files }}"
echo "Files that may need docs updates: $(echo '${{ steps.changed-files.outputs.changed_files }}' | tr '\n' ' ')"

- name: Checkout docs repository
if: steps.check-docs.outputs.needs_update == 'true'
Expand All @@ -87,21 +88,16 @@ jobs:
- name: Analyze changes and update docs
if: steps.check-docs.outputs.needs_update == 'true'
uses: anthropics/claude-code-action@beta
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
COMMIT_SHA: ${{ github.event.inputs.commit_sha }}
MERGE_COMMIT_SHA: ${{ github.event.pull_request.merge_commit_sha }}
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
direct_prompt: |
I need you to analyze the changes in this controller repository PR and update the documentation in the cartridge-gg/docs repository accordingly.

**Change Information:**
- Title: ${{ env.PR_TITLE || format('Manual trigger for commit {0}', env.COMMIT_SHA) }}
- Description: ${{ env.PR_BODY || 'Manually triggered documentation sync' }}
- Title: ${{ github.event.pull_request.title || format('Manual trigger for commit {0}', github.event.inputs.commit_sha) }}
- Description: ${{ github.event.pull_request.body || 'Manually triggered documentation sync' }}
- Files changed: ${{ steps.changed-files.outputs.changed_files }}
- Commit SHA: ${{ env.MERGE_COMMIT_SHA || env.COMMIT_SHA }}
- Commit SHA: ${{ github.event.pull_request.merge_commit_sha || github.event.inputs.commit_sha }}

**Your tasks:**
1. Review the changed files and PR description to understand what functionality was added, modified, or removed
Expand All @@ -126,12 +122,6 @@ jobs:
- name: Create branch and commit changes
if: steps.check-docs.outputs.needs_update == 'true'
working-directory: docs-repo
env:
GITHUB_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.inputs.commit_sha }}
CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }}
run: |
# Configure git
git config user.name "github-actions[bot]"
Expand All @@ -146,19 +136,19 @@ jobs:
# Add and commit changes
git add .
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
git commit -m "docs: Update documentation for controller commit $COMMIT_SHA
git commit -m "docs: Update documentation for controller commit ${{ github.event.inputs.commit_sha }}

Updates documentation to reflect changes made in commit:
$COMMIT_SHA

Manually triggered documentation sync"
Updates documentation to reflect changes made in commit:
${{ github.event.inputs.commit_sha }}
Manually triggered documentation sync"
else
git commit -m "docs: Update documentation for controller PR #$PR_NUMBER

Updates documentation to reflect changes made in:
$PR_TITLE
git commit -m "docs: Update documentation for controller PR #${{ github.event.pull_request.number }}

Related controller PR: cartridge-gg/controller#$PR_NUMBER"
Updates documentation to reflect changes made in:
${{ github.event.pull_request.title }}

Related controller PR: cartridge-gg/controller#${{ github.event.pull_request.number }}"
fi

# Push branch
Expand All @@ -167,29 +157,31 @@ Related controller PR: cartridge-gg/controller#$PR_NUMBER"
# Create PR
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
gh pr create \
--title "docs: Update documentation for controller commit $COMMIT_SHA" \
--body "This PR updates the documentation to reflect changes made in cartridge-gg/controller commit $COMMIT_SHA
--title "docs: Update documentation for controller commit ${{ github.event.inputs.commit_sha }}" \
--body "This PR updates the documentation to reflect changes made in cartridge-gg/controller commit ${{ github.event.inputs.commit_sha }}

**Commit Details:**
- Commit SHA: $COMMIT_SHA
- Files changed: $CHANGED_FILES
- Trigger: Manual documentation sync
**Commit Details:**
- Commit SHA: ${{ github.event.inputs.commit_sha }}
- Files changed: ${{ steps.changed-files.outputs.changed_files }}
- Trigger: Manual documentation sync

Please review the documentation changes to ensure they accurately reflect the controller updates."
Please review the documentation changes to ensure they accurately reflect the controller updates."
else
gh pr create \
--title "docs: Update documentation for controller PR #$PR_NUMBER" \
--body "This PR updates the documentation to reflect changes made in cartridge-gg/controller#$PR_NUMBER
--title "docs: Update documentation for controller PR #${{ github.event.pull_request.number }}" \
--body "This PR updates the documentation to reflect changes made in cartridge-gg/controller#${{ github.event.pull_request.number }}

**Original PR Details:**
- Title: $PR_TITLE
- Files changed: $CHANGED_FILES
**Original PR Details:**
- Title: ${{ github.event.pull_request.title }}
- Files changed: ${{ steps.changed-files.outputs.changed_files }}

Please review the documentation changes to ensure they accurately reflect the controller updates."
Please review the documentation changes to ensure they accurately reflect the controller updates."
fi
else
echo "No documentation changes were made by Claude"
fi
env:
GITHUB_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}

- name: Cleanup
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Tests
name: e2e-tests

on:
repository_dispatch:
Expand Down
Loading