Skip to content

Unable To Set Up GitHub Action #40

@xanderdunn

Description

@xanderdunn

Unfortunately I haven't been able to get the Claude Code Action working in GitHub CI either via the claude CLI /install-github-app, nor via manual configuration. We have a GitHub Enterprise account, but we are not using a custom Claude Code setup, we are directly using the Anthropic API. We're successfully using other GitHub apps, including GitHub Copilot, Google Labs Jules, ChatGPT Connector, etc.

When I run the /install-github-app command, I see:
Image
I am signed into GitHub as an admin user.

The GitHub App is correctly installed:
Image

And the API secret is set on the repo:
Image

So, I tried to set this up manually with .github/workflows/claude_pr_review.yml:

# This should automatically start a code review when any PR is opened
name: Claude Code Review

on:
  pull_request:
    types: [opened, synchronize]  # Runs on new PRs and updates

jobs:
  code-review:
    runs-on: ubuntu-latest
    steps:
      # Check out the code to allow git diff operations
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Fetch full history for accurate diffs

      - name: Run Code Review with Claude
        id: code-review
        uses: anthropics/claude-code-action@beta
        with:
          # Define the review focus areas
          prompt: "Review the PR changes. Focus on code quality, potential bugs, performance issues, typos, and outdated docs or code. Suggest improvements where appropriate."

          # Limited tools for safer review operations
          allowed_tools: [
            "Bash(git diff --name-only HEAD~1)",  # List changed files
            "Bash(git diff HEAD~1)",              # See actual changes
            "View",                               # Read file contents
            "GlobTool",                          # Find related files
            "GrepTool"                           # Search for patterns
          ]

          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

I authorized the workflow, and then it fails:
Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions