> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code GitHub Actions User Guide

> Claude Code 集成指南 - Ace Data Cloud

Claude Code is an **Agentic Coding** tool launched by Anthropic, also known as one of the world's strongest programming agents. Claude Code GitHub Actions can integrate AI programming capabilities into your GitHub workflow; simply `@claude` in a PR or Issue, and Claude will automatically analyze the code, create PRs, implement features, and fix bugs.

This document mainly introduces how to configure and use Claude Code GitHub Actions through AceData Cloud's proxy service.

## Application Process

To use Claude Messages service page, first open the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications) and copy your API Token.

![](https://cdn.acedata.cloud/5hmkdg.jpg)

If you are not logged in, you will be redirected to sign in and brought back to this page automatically.

**A single API Token works across every service on the platform — no need to subscribe per service.** New accounts receive free starter credit; when it runs low you can top up your shared balance in the [console](https://platform.acedata.cloud/console/coin).

> 📘 Full documentation: [Claude Messages service page →](https://platform.acedata.cloud/documents/claude-messages)

## Features

* **Instant PR Creation**: Describe your needs, and Claude will automatically create a complete Pull Request.
* **Automatic Code Implementation**: In an Issue, `@claude` will turn the Issue into runnable code.
* **Adherence to Project Standards**: Automatically reads `CLAUDE.md` to follow your coding style and project standards.
* **Safe and Reliable**: Code runs on GitHub's Runner, ensuring data security.

## Configuration Steps

### Step One: Install Claude GitHub App

Go to [https://github.com/apps/claude](https://github.com/apps/claude) to install the Claude GitHub App to your repository.

![GitHub Claude App Installation Page](https://cdn.acedata.cloud/ba4b8df66d.png)

This App requires the following repository permissions:

| Permission        | Level        | Description                 |
| ----------------- | ------------ | --------------------------- |
| **Contents**      | Read & Write | Modify repository files     |
| **Issues**        | Read & Write | Respond to Issues           |
| **Pull requests** | Read & Write | Create PRs and push changes |

### Step Two: Add API Key

Add the AceData Cloud API key as a repository Secret:

1. Go to the repository **Settings** → **Secrets and variables** → **Actions**
2. Click **New repository secret**
3. Name it `ANTHROPIC_API_KEY`, and enter the API token you obtained from AceData Cloud in the Value field.
4. Click **Add secret** to save.

> **Tip**: The API token can be viewed in the [AceData Cloud Console](https://platform.acedata.cloud/console).

### Step Three: Create Workflow File

Create a `.github/workflows/claude.yml` file in the repository:

```yaml theme={null}
name: Claude Code
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  issues:
    types: [opened, assigned]
  pull_request:
    types: [opened, synchronize]

jobs:
  claude:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
```

If you need to use AceData Cloud's proxy API endpoint, you also need to set environment variables in the Workflow:

```yaml theme={null}
name: Claude Code
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]

jobs:
  claude:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        env:
          ANTHROPIC_BASE_URL: "https://api.acedata.cloud"
```

## Usage

### Using in Issue or PR Comments

After configuration, in any Issue or PR comment, `@claude`, and Claude will automatically respond:

```
@claude Implement the functionality based on the description of this Issue
@claude Review the code safety of this PR
@claude Fix the TypeError in the user dashboard component
@claude How should user authentication for this endpoint be implemented?
```

### Automatic Code Review

Create a Workflow that automatically performs code reviews when a PR is opened:

```yaml theme={null}
name: Code Review
on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "/review"
          claude_args: "--max-turns 5"
        env:
          ANTHROPIC_BASE_URL: "https://api.acedata.cloud"
```

### Scheduled Task Automation

Create an automated task that runs on a schedule:

```yaml theme={null}
name: Daily Report
on:
  schedule:
    - cron: "0 9 * * *"

jobs:
  report:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Generate a summary of yesterday's commits and a report of unresolved Issues"
        env:
          ANTHROPIC_BASE_URL: "https://api.acedata.cloud"
```

## Action Parameter Description

| Parameter           | Description                                            | Required |
| ------------------- | ------------------------------------------------------ | -------- |
| `anthropic_api_key` | API key                                                | Yes      |
| `prompt`            | Instructions for Claude (text or Skill like `/review`) | No       |
| `claude_args`       | Parameters passed to Claude Code CLI                   | No       |
| `github_token`      | GitHub Token                                           | No       |
| `trigger_phrase`    | Custom trigger phrase (default `@claude`)              | No       |

### Common `claude_args` Parameters

```yaml theme={null}
claude_args: "--max-turns 5 --model claude-sonnet-4-5-20250929"
```

| Parameter         | Description                         |
| ----------------- | ----------------------------------- |
| `--max-turns`     | Maximum dialogue turns (default 10) |
| `--model`         | Model to use                        |
| `--mcp-config`    | Path to MCP configuration file      |
| `--allowed-tools` | Allowed tools (comma-separated)     |
| `--debug`         | Enable debug output                 |

## Best Practices

### Configure CLAUDE.md

Create a `CLAUDE.md` file in the root directory of the repository to define coding style guidelines, review standards, and project specifications; Claude will automatically follow these rules.

### Security Considerations

* **Never** write API keys directly in Workflow files.
* Always use GitHub Secrets (e.g., `${{ secrets.ANTHROPIC_API_KEY }}`).
* Limit Action permissions to the minimum necessary scope.
* Manually review Claude's suggestions before merging.

### Cost Control

* Use explicit `@claude` commands to reduce unnecessary API calls.
* Set reasonable `--max-turns` limits on dialogue turns.
* Set timeout limits at the Workflow level.
* Use GitHub's concurrency control to limit the number of parallel runs.

## Frequently Asked Questions

### Why is Claude not responding to the @claude command?

1. Confirm that the Claude GitHub App is correctly installed.
2. Check if the Workflow is enabled.
3. Ensure the API key is set as a repository Secret.
4. Make sure to use `@claude` in the comment (not `/claude`).

### Authentication Error?

1. Confirm that the API key is valid and has sufficient permissions.
2. Check if the Secret name is correct (`ANTHROPIC_API_KEY`).
3. If using `ANTHROPIC_BASE_URL`, confirm that the URL is correct.

### How to Check Remaining Quota?

Log in to the [AceData Cloud Console](https://platform.acedata.cloud/console) to view the current account's remaining quota and usage.

## Learn More

* 📖 [Claude Code GitHub Actions Official Documentation](https://code.claude.com/docs/en/github-actions)
* 📂 [claude-code-action Repository](https://github.com/anthropics/claude-code-action)
* 📋 [Workflow Examples](https://github.com/anthropics/claude-code-action/tree/main/examples)
* 🔧 [AceData Cloud Claude Code Service](https://platform.acedata.cloud/documents/claude-messages)
* 💬 If you have any questions, feel free to contact us through the platform's customer service.
