surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| 1 | name: Claude Code |
| 2 | |
| 3 | on: |
| 4 | issue_comment: |
| 5 | types: [created] |
| 6 | pull_request_review_comment: |
| 7 | types: [created] |
| 8 | issues: |
| 9 | types: [opened, assigned] |
| 10 | pull_request_review: |
| 11 | types: [submitted] |
| 12 | |
| 13 | jobs: |
| 14 | claude: |
| 15 | if: | |
| 16 | (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 17 | (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
| 18 | (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || |
| 19 | (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
| 20 | # This job calls Claude, so it runs on GitHub's egress-firewall runner, which |
| 21 | # filters the job's outbound network traffic (allow list: .github/egress-firewall.yaml). |
| 22 | runs-on: ubuntu-24.04-firewall |
| 23 | permissions: |
| 24 | contents: read |
| 25 | pull-requests: read |
| 26 | issues: read |
| 27 | id-token: write |
| 28 | steps: |
| 29 | - name: Checkout repository |
| 30 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 31 | with: |
| 32 | fetch-depth: 1 |
| 33 | |
| 34 | - name: Run Claude Code |
| 35 | id: claude |
| 36 | uses: anthropics/claude-code-action@v1 |
| 37 | with: |
| 38 | # Authenticate to the Claude API via Workload Identity Federation |
| 39 | # (the workflow's OIDC token is exchanged for a short-lived access |
| 40 | # token) instead of a static API key. |
| 41 | anthropic_federation_rule_id: ${{ vars.ANTHROPIC_FEDERATION_RULE_ID }} |
| 42 | anthropic_organization_id: ${{ vars.ANTHROPIC_ORGANIZATION_ID }} |
| 43 | anthropic_service_account_id: ${{ vars.ANTHROPIC_SERVICE_ACCOUNT_ID }} |
| 44 | anthropic_workspace_id: ${{ vars.ANTHROPIC_WORKSPACE_ID }} |
| 45 | # --permission-mode auto: a tool call that needs permission and that the allowed tools |
| 46 | # do not cover runs only if Claude Code's safety review passes it. The action sets |
| 47 | # --permission-mode acceptEdits for @claude mentions, and this one, which comes after it, wins. |
| 48 | claude_args: "--model claude-sonnet-4-6 --permission-mode auto" |
| 49 |