Skip to content

Auto-generated PR: Update zed docs #218

Auto-generated PR: Update zed docs

Auto-generated PR: Update zed docs #218

Workflow file for this run

---
name: "Claude Code"
# Note: only users with write permissions can invoke Claude jobs
"on":
issue_comment:
types: ["created"]
pull_request_review_comment:
types: ["created"]
issues:
types: ["labeled"]
pull_request_review:
types: ["submitted"]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to process"
required: true
type: "number"
jobs:
# Disable general claude invocations
# claude:
# if: |
# (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
# (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
# (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
# (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
# runs-on: ubuntu-latest
# permissions:
# contents: read
# pull-requests: read
# issues: read
# id-token: write
# actions: read # Required for Claude to read CI results on PRs
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
#
# - name: Run Claude Code
# id: claude
# uses: anthropics/claude-code-action@v1
# with:
# anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
#
# # This is an optional setting that allows Claude to read CI results on PRs
# additional_permissions: |
# actions: read
#
# # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# # prompt: 'Update the pull request description to include a summary of changes.'
#
# # Optional: Add claude_args to customize behavior and configuration
# # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# # or https://code.claude.com/docs/en/cli-reference for available options
# # claude_args: '--allowed-tools Bash(gh pr:*)'
suggestion:
name: "Suggestion Handler"
concurrency:
group: "doc-suggestion-${{ github.event.issue.number || inputs.issue_number }}"
cancel-in-progress: false
if: |
(github.event_name == 'issues' &&
github.event.action == 'labeled' &&
contains(github.event.issue.labels.*.name, 'suggestion/accepted')) ||
github.event_name == 'workflow_dispatch'
runs-on: "ubuntu-latest"
permissions:
contents: "write"
pull-requests: "read"
issues: "write"
id-token: "write"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: "Validate issue label for manual trigger"
if: "github.event_name == 'workflow_dispatch'"
env:
GH_TOKEN: "${{ github.token }}"
ISSUE_NUMBER: "${{ inputs.issue_number }}"
run: |
labels=$(gh issue view $ISSUE_NUMBER --json labels --jq '.labels[].name' || echo "")
if ! echo "$labels" | grep -q "suggestion/accepted"; then
echo "Error: Issue #$ISSUE_NUMBER does not have the 'suggestion/accepted' label"
exit 1
fi
echo "Issue #$ISSUE_NUMBER has the required 'suggestion/accepted' label"
# Runs claude code implement the suggestion.
# Configured to give 50 turns to claude based on observations. This can be increased if we observe sessions failing to complete
- name: "Run Claude Code for Suggestion"
id: "claude-suggestion"
timeout-minutes: 30
uses: "anthropics/claude-code-action@v1"
env:
ISSUE_NUMBER: "${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}"
with:
anthropic_api_key: "${{ secrets.ANTHROPIC_API_KEY }}"
# Full output may expose secrets - do not enable on public repos
# See: https://github.com/anthropics/claude-code-action/blob/main/docs/security.md
show_full_output: false
prompt: |
Read the repository documentation structure and the issue description for issue #${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}.
The issue has been labeled as "suggestion/accepted" and contains a documentation request or improvement.
Your task:
1. Read and understand the current documentation structure in this repository
2. Review the issue description and any comments to understand what documentation changes are needed
3. Create a new branch using the format: suggestion/issue-${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}-<short-description>
Example: suggestion/issue-1-starter-program-docs
Use: git checkout -b <branch-name>
4. Implement the requested documentation changes by editing existing pages or creating new pages as appropriate
5. Ensure all changes follow the existing documentation style, formatting, and structure
6. Commit your changes with messages that include "Fixes #${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}" so the issue will automatically close when the PR is merged.
7. Push your branch to origin using: git push -u origin <branch-name>
8. Post a comment to issue #${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }} with:
- Summary of changes made
- Highlight any actions attempted but did not have access to complete
- Link to create a PR using: https://github.com/${{ github.repository }}/compare/<branch-name>?expand=1
Use the gh CLI: gh issue comment ${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }} --body "<your comment>"
RESTRICTIONS:
- Only modify documentation files (.mdx, .md) in app/
- Only modify _meta.ts for navigation entries
- May add components to components/ for documentation display
- NEVER modify .github/, scripts/, or root config files (package.json, next.config.mjs, etc.)
- If the request is out of scope, comment explaining why
claude_args: |
--allowedTools "Read,Write,Edit,Bash(git:*),Bash(gh:*),WebFetch(domain:authzed.com)"
--max-turns 50
- name: "Notify on failure"
if: "failure()"
continue-on-error: true
env:
GH_TOKEN: "${{ github.token }}"
ISSUE_NUMBER: "${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}"
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
run: |
# Don't fail if notification fails
gh issue comment "$ISSUE_NUMBER" --body "## Documentation Workflow Failed
The automated documentation workflow encountered an error and could not complete.
**Workflow run**: $RUN_URL
A maintainer will investigate. You can also check the workflow logs for details.
---
*Automated notification from GitHub Actions*" || echo "::warning::Failed to post failure notification"
- name: "Notify on timeout/cancel"
if: "cancelled()"
continue-on-error: true
env:
GH_TOKEN: "${{ github.token }}"
ISSUE_NUMBER: "${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}"
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
run: |
gh issue comment "$ISSUE_NUMBER" --body "## Documentation Workflow Cancelled/Timed Out
The workflow was cancelled or timed out after 30 minutes.
**Possible causes:**
- Request is too complex (try breaking into smaller issues)
- Claude encountered a difficult decision
- External service was slow to respond
**Workflow run**: $RUN_URL
---
*Automated notification from GitHub Actions*" || echo "::warning::Failed to post timeout notification"