anthropics/claude-code-base-action

This repo is a mirror of the contents of base-action in https://github.com/anthropics/claude-code-action.

What it solves

This project provides a GitHub Action that allows developers to integrate Claude Code—an agentic CLI tool—directly into their GitHub Actions workflows. It enables the automation of complex coding tasks, such as PR reviews, dependency updates, and environment-specific deployments, by running Claude Code within a CI/CD pipeline.

How it works

The action acts as a thin wrapper around the Claude Code CLI. It installs the CLI and executes it using provided inputs. It supports multiple authentication methods, including direct Anthropic API keys, OAuth tokens, and Workload Identity Federation (OIDC) for secure, keyless authentication with Anthropic, Amazon Bedrock, or Google Vertex AI.

Users can configure the agent's behavior via prompt or prompt_file, and pass additional CLI arguments (like --allowedTools to restrict tool access) and settings (via JSON) to control the model, environment variables, and tool permissions.

Who it’s for

Developers and DevOps engineers who want to build custom automated workflows on top of Claude Code within GitHub Actions, particularly for tasks that require an agentic approach to code modification and review.

Highlights

  • Flexible Authentication: Supports API keys, OAuth tokens, and OIDC-based Workload Identity Federation.
  • Cloud Provider Integration: Compatible with Amazon Bedrock and Google Vertex AI.
  • Customizable Tooling: Ability to restrict or allow specific tools (e.g., Bash, Read, Glob) via CLI arguments.
  • MCP Support: Integration with Model Context Protocol (MCP) servers for extended capabilities.
  • Structured Output: Supports --json-schema for typed automation output via the structured_output action output.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch