name: Claude Mode Examples on: # Events for tag mode issue_comment: types: [created] issues: types: [opened, labeled] pull_request: types: [opened] # Events for agent mode (only these work with agent mode) workflow_dispatch: schedule: - cron: "0 0 * * 0" # Weekly on Sunday jobs: # Tag Mode (Default) - Traditional implementation tag-mode-example: runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write id-token: write steps: - uses: anthropics/claude-code-action@beta with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # Tag mode (default) behavior: # - Scans for @claude mentions in comments, issues, and PRs # - Only acts when trigger phrase is found # - Creates tracking comments with progress checkboxes # - Perfect for: Interactive Q&A, on-demand code changes # Agent Mode - Automation for workflow_dispatch and schedule events agent-mode-scheduled-task: # Only works with workflow_dispatch or schedule events runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write id-token: write steps: - uses: anthropics/claude-code-action@beta with: mode: agent anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} override_prompt: | Check for outdated dependencies and security vulnerabilities. Create an issue if any critical problems are found. # Agent mode behavior: # - ONLY works with workflow_dispatch and schedule events # - Does NOT work with pull_request, issues, or issue_comment events # - No @claude mention needed for supported events # - Perfect for: scheduled maintenance, manual automation runs