How to use Claude Code with GitHub Actions and GitLab CI/CD for automated workflows. Use when user asks about CI/CD integration, GitHub Actions, GitLab pipelines, or automated development workflows.
Integrates Claude with GitHub Actions and GitLab CI/CD to automate development workflows. Triggers when `@claude` is mentioned in PRs, MRs, or issues to create implementations, fix bugs, and review code.
/plugin marketplace add reggiechan74/claude-plugins/plugin install claude-code-metaskill@claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Claude Code integrates with CI/CD platforms to enable AI-powered automation within development workflows. By mentioning @claude in pull requests, merge requests, or issues, you can leverage Claude to analyze code, create PRs/MRs, implement features, and fix bugs while adhering to project standards.
Core Features:
CLAUDE.md filesQuick Installation:
Run /install-github-app in Claude Code for guided setup and secret configuration. This approach is limited to direct Claude API users.
Manual Setup Requirements:
ANTHROPIC_API_KEY to repository secrets.github/workflows/Example Workflow:
- uses: anthropics/claude-code-action@v1
with:
prompt: "Your instructions"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: "--max-turns 5"
Version Migration (v1.0):
mode configuration (now auto-detected)direct_prompt to promptclaude_args parameterIn comments:
@claude implement this feature
@claude fix the TypeError in the dashboard
@claude how should I handle authentication?
Project Guidelines: Create a CLAUDE.md file defining coding standards and review criteria that Claude will follow.
Security: Always use GitHub Secrets rather than hardcoding credentials. Store API keys as ANTHROPIC_API_KEY.
Cost Management: Configure --max-turns limits and use specific commands to minimize unnecessary API calls.
AWS Bedrock and Google Vertex AI integration requires:
Both approaches eliminate need for static credentials through temporary token rotation.
No Response: Verify GitHub app installation, workflow enablement, and use of @claude (not /claude).
CI Not Running: Confirm app usage instead of default Actions user and verify webhook trigger configuration.
Authentication Issues: Validate API key permissions and confirm secret naming in workflows.
Claude Code integrates with GitLab CI/CD to enable AI-powered development workflows. The integration is currently in beta and maintained by GitLab.
1. Add CI/CD Variable:
Store ANTHROPIC_API_KEY as a masked variable in Settings → CI/CD → Variables
2. Configure .gitlab-ci.yml: Add a Claude job stage that:
3. Trigger Methods:
@claudeClaude API (SaaS): Use ANTHROPIC_API_KEY
AWS Bedrock: Configure OIDC authentication with:
AWS_ROLE_TO_ASSUME variableAWS_REGION variableGoogle Vertex AI: Set up Workload Identity Federation with:
GCP_WORKLOAD_IDENTITY_PROVIDERGCP_SERVICE_ACCOUNTCLOUD_ML_REGIONConvert Issues to MRs: Comment @claude implement this feature based on the issue description
Get Implementation Help: In MR discussions: @claude suggest a concrete approach to [task]
Fix Bugs: @claude fix the [error type] in [component]
CLAUDE.md for consistent behaviorCreate employment contracts, offer letters, and HR policy documents following legal best practices. Use when drafting employment agreements, creating HR policies, or standardizing employment documentation.
Implement GDPR-compliant data handling with consent management, data subject rights, and privacy by design. Use when building systems that process EU personal data, implementing privacy controls, or conducting GDPR compliance reviews.