Running Claude Code and Codex in GitHub Actions: setup, secrets, and safety
How to run Claude Code (/install-github-app, @claude) and Codex (openai/codex-action@v1) in GitHub Actions, manage secrets, and sync GitHub issues in Mirasim.


The short answer
Both Anthropic and OpenAI publish official GitHub Actions. For Claude Code, run /install-github-app inside your repo to install the Claude GitHub App, save an API key or subscription token as a repo secret, and open a PR with @claude workflows. For Codex, add openai/codex-action@v1 to a workflow with secrets.OPENAI_API_KEY, which installs the CLI and runs codex exec on your runner.
| Claude Code GitHub Actions | Codex GitHub Action | |
|---|---|---|
| Official action | anthropics/claude-code-action | openai/codex-action@v1 |
| Quickest setup | gh auth login, then /install-github-app in claude | Add workflow YAML with openai/codex-action@v1 |
| Repository secret | ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN | OPENAI_API_KEY |
| Typical triggers | @claude mentions in issues/PRs, or any GitHub event | pull_request, releases, or custom CI jobs via codex exec |
| Runner notes | Works on github.com (GitLab has a separate CI guide) | Linux / macOS by default (drop-sudo); Windows needs safety-strategy: unsafe |
Claude Code GitHub Actions (/install-github-app)
You need repository admin access to set up claude-code-action. Quick setup handles the GitHub App, secret, and workflow PR in one guided flow:
- Sign in with GitHub CLI
Install
ghand rungh auth login, then launchclaudeinside your repository. - Run
/install-github-appInstall the Claude GitHub App on your repo in the browser (granting read/write access to Contents, Issues, and Pull requests), then return to the terminal and pick which workflows (
@claudementions and/or PR review) to add. - Save the credential and merge the PR
Choose a long-lived subscription token (
CLAUDE_CODE_OAUTH_TOKEN) or an API key (ANTHROPIC_API_KEY). Claude Code pushes the workflow files to a branch and opens a PR; once merged, tag@claudein any issue or PR comment.
Once enabled, commenting @claude fix the TypeError in the dashboard component makes Claude reply on the same issue or PR and update the comment as it investigates and pushes commits.
Codex GitHub Action (openai/codex-action@v1)
OpenAI's official action installs the Codex CLI on your GitHub Actions runner, starts a local proxy for your API key, and runs codex exec with either an inline prompt or a checked-in prompt-file. Capture its result through steps.<id>.outputs.final-message or output-file.
name: Codex PR check
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
codex:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- name: Run Codex
id: run_codex
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/review.md
sandbox: read-only
output-file: codex-output.mdSyncing GitHub issues and PRs across agents in Mirasim
GitHub Actions fits headless CI jobs, while interactive bug fixing and cross-agent work are faster when issues, worktrees, and PRs live together without waiting for cold CI runners.
- Connect GitHub, GitLab, Gitee, or self-hosted hosts: under Settings › Account › Connected accounts › Code hosting, each teammate links their own GitHub, GitLab, Gitee, GitHub Enterprise, or Gitea account so every clone, pull, and push runs under whoever started it.
- Import external issues into Work Items: sync GitHub, GitLab, Jira, or Gitea issues into Work Items and route them by rules, then kick off Claude Code, Codex, or any of the 11 agents in its own Git worktree and track PR status in the workspace.
Article · 96 releases in 20 days: how a small team ships multiple times a day → How a team connects external issue trackers and ships multiple releases a day in Mirasim.
Questions
- Can I use a Claude subscription instead of an API key in GitHub Actions?
- Yes.
/install-github-applets you choose between generating a long-lived subscription token (CLAUDE_CODE_OAUTH_TOKEN) and saving anANTHROPIC_API_KEYrepository secret. - What is the difference between Claude Code GitHub Actions and
@claude review? claude-code-actionruns inside your own GitHub Actions workflow files and can answer@claudementions, edit code, and push commits. Anthropic's managed Code Review service runs on Team and Enterprise plans without workflow YAML.- Does
openai/codex-action@v1work with a ChatGPT subscription? - No. The Codex GitHub Action expects an OpenAI API key stored as a GitHub secret (such as
OPENAI_API_KEY). For subscription-backed PR reviews without CI YAML, use Codex's GitHub integration (@codex review).
Article · Code review with Claude Code and Codex: /review, GitHub reviews and a second opinion → Code review with Claude Code and Codex: /review, @claude review, and @codex review.
Article · Using an API key with Claude Code and Codex: setup, custom endpoints, and switching back → Using an API key with Claude Code and Codex (including CI `CODEX_API_KEY`).
Article · Scheduled tasks in Claude Code and Codex: /loop, cloud tasks, and recurring automations → Running Claude Code and Codex on a schedule outside GitHub Actions.
Article · Running Claude Code (`claude -p`) and Codex (`codex exec`) in scripts and CI → Running `claude -p` and `codex exec` non-interactively in scripts and CI.
Sources
Checked on November 29, 2026 against Anthropic's Claude Code GitHub Actions guide (code.claude.com/docs/en/github-actions) and OpenAI's Codex GitHub Action guide (learn.chatgpt.com/docs/github-action). Check those pages for the latest inputs and runner requirements.
Keep reading

Fixing OpenAI and Codex 403 “unsupported_country_region_territory”
Why OpenAI and Codex return 403 unsupported_country_region_territory, how to fix false positives on VPNs or cloud IPs, and compliant alternatives.

Running Claude Code and Codex on Amazon Bedrock, Vertex AI, and Microsoft Foundry
Connect Claude Code and Codex to Amazon Bedrock, Vertex AI, and Microsoft Foundry: env vars, config.toml, auth, model pinning, and limits.

Using Claude Code with Chrome and Codex Browser: live debugging, Playwright, and previews
How to connect Claude Code to Chrome (extension, console logs, login limits) and use Codex Browser or Playwright, plus live dev-server previews in Mirasim.