- Text From Other People: Triggering a run does not make someone else's text a request. When a maintainer labels or assigns another person's issue, slash commands in its body do not run, but Claude still reads the body to understand the task, so review it first. A pull request's body can also start a run when a maintainer pushes to, reopens or labels it, where
track_progressis set. Editing or dismissing another person's comment or review, or deleting any comment, does not start a run, even with aprompt. - Repository Access: The action can only be triggered by users with write access to the repository. This is checked for issue, pull request, comment, and review events, and for
workflow_runevents, where both the workflow actor and the actor that started the upstream run are checked.workflow_dispatch,repository_dispatch, andscheduleevents are not checked separately — GitHub itself requires write access to dispatch a workflow, and scheduled runs have no external actor. - Bot User Control: By default, GitHub Apps and bots cannot trigger this action for security reasons. Use the
allowed_botsparameter to enable specific bots or all bots⚠️ Allowed bots are not checked for repository permissions. A bot that matches an entry does not need to be installed on your repository or have write access. On a public repository, external parties — including GitHub Apps created by anyone — may be able to trigger workflow events such as opening issues, commenting, or reviewing pull requests. If your workflow listens on those events andallowed_botsis set to'*', any such App can invoke this action with a prompt it controls.- On
pull_requestevents, a bot's activity does not vouch for the pull request. Before a run starts, its author must also have write access or be an allowed bot. - When
allowed_botsis set, the token stays out of.git/configand git gets it from a credential helper that readsGH_TOKEN. A later step that uses theoriginremote to push, or to fetch, pull or update submodules on a private repository, then needs its own credentials.originnames the usernamex-access-token, so those must come fromGH_TOKEN,GIT_ASKPASS, a credential saved under that username, or a remote URL the step sets itself. The token is still in Claude's environment. - Prefer an explicit list over
'*' - Only list App names you trust
- If you need
'*', scope workflowpermissions:to the minimum required
⚠️ Non-Write User Access (RISKY): Theallowed_non_write_usersparameter allows bypassing the write permission requirement. This is a significant security risk and should only be used for workflows with extremely limited permissions (e.g., issue labeling workflows that only haveissues: writepermission). This feature:- Only works when
github_tokenis provided as input (not with GitHub App authentication) - Accepts either a comma-separated list of specific usernames or
*to allow all users - Should be used with extreme caution as it bypasses the primary security mechanism of this action
- Is designed for automation workflows where user permissions are already restricted by the workflow's permission scope
- When set, Claude does a best-effort scrub of Anthropic, cloud, and GitHub Actions secrets from subprocess environments. On Linux runners with bubblewrap available, subprocesses additionally run with PID-namespace isolation. This reduces but does not eliminate prompt injection risk — keep workflow permissions minimal and validate all outputs. Set
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: 0in your workflow or jobenv:block to opt out. - Optionally set
CLAUDE_CODE_SCRIPT_CAPSin your workflowenv:block to limit how many times Claude can call specific scripts per run. Value is JSON:{"script-name.sh": maxCalls}. Example:CLAUDE_CODE_SCRIPT_CAPS: '{"edit-issue-labels.sh":2}'allows at most 2 calls toedit-issue-labels.sh. Useful for write-capable helper scripts. - Runs with this input or
allowed_botskeep the earlier permission defaults instead of auto mode, so the safety review can't pass a call those defaults deny, unlessclaude_argssets another permission mode - When using
allowed_non_write_users, always passgithub_token: ${{ secrets.GITHUB_TOKEN }}. The auto-generated workflow token is scoped to the job's declared permissions and expires when the job completes. Do not use a personal access token — a static token does not rotate between runs and could be partially or fully recovered over time via prompt injection. Restricting allowed tools viaclaude_argsreduces the rate of recovery but may not eliminate the risk. We recommend restricting allowed tools (e.g.claude_args: '--allowedTools "Bash(gh issue view:*)"') to the minimum required when usingallowed_non_write_users.
- Only works when
- Token Permissions: The GitHub app receives only a short-lived token scoped specifically to the repository it's operating in
- No Cross-Repository Access: Each action invocation is limited to the repository where it was triggered
- Limited Scope: The token cannot access other repositories or perform actions beyond the configured permissions
For workflow_run events, the action checks the repository access of the actor that started the upstream run (for example, the author of the fork pull request that triggered your CI workflow) in addition to the workflow actor. When the run came from a fork, it also checks the fork's owner, because GitHub credits a run to whoever caused it, such as a maintainer reopening the pull request. If any of these accounts does not have write access, the action stops before running Claude. The action skips a run from a fork unless allow_fork_prs is true. To run on workflow_run events downstream of pull requests from contributors without write access, also add those users to allowed_non_write_users and pass github_token: ${{ secrets.GITHUB_TOKEN }} — see the notes on that input above and keep the workflow's permissions minimal.
pull_request_target and workflow_run execute with the base repository's secrets. If your workflow checks out the PR head (ref: ${{ github.event.pull_request.head.sha }} for pull_request_target, ref: ${{ github.event.workflow_run.head_sha }} for workflow_run) into $GITHUB_WORKSPACE before this action, the action and Claude run with that checkout as the working directory.
Do not check out an untrusted ref into the workspace root before this action. Use one of these patterns instead:
# Preferred — check out the base ref (default).
- uses: actions/checkout@v6 # no `ref:` → base branch
- uses: anthropics/claude-code-action@v1# If you need the PR's files locally — check out the base ref at the workspace
# root (this action expects a git repo there), then check out the head ref into
# a subdirectory and pass it via --add-dir.
- uses: actions/checkout@v6 # no `ref:` → base branch at workspace root
- uses: actions/checkout@v6
with:
# For workflow_run use: ${{ github.event.workflow_run.head_sha }}
ref: ${{ github.event.pull_request.head.sha }}
path: pr-head
- uses: anthropics/claude-code-action@v1
with:
claude_args: "--add-dir pr-head"This is general guidance for these event types — see GitHub's documentation.
When the action runs against a pull request, it restores a fixed list of Claude configuration paths from the PR base branch before starting Claude: .claude/, .mcp.json, .claude.json, .gitmodules, .ripgreprc, CLAUDE.md, CLAUDE.local.md, AGENTS.md, and .husky/. Paths in that list that do not exist on the base branch are removed, and the PR-authored versions are kept under .claude-pr/ for reference only.
On a pull request whose author does not have write access, everything this section takes from the base branch comes from your default branch instead, even if the pull request targets another branch such as a release branch. To use a different branch for pull requests that don't target the default branch, set the base_branch input to a fixed branch name, never to a value from the pull request. On pull request and review events, the default branch is used if the input equals the pull request's head branch name. Changes to these files are left out when Claude commits with its commit command. A bot's pull request from a branch in your repository still uses its base, unless that is a pr-N branch or a comment in the pull request's conversation started the run and the pull request is closed or the workflow has a prompt without track_progress. restrict_untrusted_prs: false turns this off.
Everything else in the working tree — including package.json, lockfiles, Makefile, node_modules/, and formatter/linter config files — stays at the PR head, apart from the files described below. If a hook, apiKeyHelper, or statusLine command in your base-branch .claude/settings.json runs a package-manager script (bun run …, npm run …, yarn …, pnpm run …), a make target, a repo-relative script, or a tool that loads executable project config, that command resolves through files the pull request supplies. Keep such commands self-contained: invoke the tool directly with a pinned version and pass its configuration on the command line (for example bunx prettier@3.5.3 --no-config --write . rather than bun run format).
On pull requests from authors without write access, the action also replaces what npm and Bun read from the repository root with the base branch's version, wherever the two differ: .npmrc, bunfig.toml and tracked files in node_modules/. In a package.json whose name, bin, directories.bin or workspaces change the commands it provides, only name, bin, directories and workspaces are replaced, or the whole file if it can't be understood, including in other directories if the base branch uses workspaces. The pull request's versions are kept under .claude-pr/ for reading, except for node_modules/. Claude can't edit .npmrc, bunfig.toml, node_modules/ or, where one was replaced, package.json on these pull requests, in any directory. Its Bash commands start in the repository root there, because a hook runs in the session's current directory and only the root's files are replaced. The replaced files stay in the working tree for later steps in the job, and if Claude stages everything, its commit can include them, as with the paths above. restrict_untrusted_prs: false turns this off.
On these pull requests, files and directories in the checkout that your workflow's inputs name also come from the base branch where the pull request changes them or a .gitattributes that applies to them: settings, plugin_marketplaces, and in claude_args --settings, --mcp-config, --plugin-dir, --plugin-dir-no-mcp, --agents, --project-config-root, --system-prompt-file, --append-system-prompt-file and --append-subagent-system-prompt-file. The pull request's versions are kept under .claude-pr/ for reading, and Claude can't edit what these inputs name, apart from the paths listed above. The replaced files stay in the working tree here too. A file that only the pull request has is removed. The run stops if an input names the whole repository as a plugin or marketplace, except that a marketplace at the root works if all its plugins are in subdirectories, if it names a path with .. after another directory, or if it names files in a submodule that the pull request has at another commit. What symbolic links lead to, files that other config names, for example in a settings.json, and executables are not covered. Git LFS files are written as pointers.
This doesn't cover other package managers, the .env files and tsconfig.json that Bun loads, other files that a hook's own command reads, or a git command that resets the working tree during the session, so keep hooks self-contained as described above. Files that git doesn't track, such as packages an earlier step installed, stay as they are. A file that is the same link on both branches is left as a link.
Note that the runtime executing the tool also reads project config. bunx <tool> runs the tool's script under node when node is on PATH (as it is on GitHub-hosted runners); when only Bun is available, Bun executes the script itself and reads bunfig.toml from the checkout — including preload entries — which comes from the PR head. On such runners, make sure node is on PATH for the hook, and treat bunfig.toml and .npmrc in the checkout as PR-controlled runtime config on pull requests from authors with write access.
By default, the action skips pull requests from forks, so that it never checks out a fork's code itself. To let someone with write access have it work on them, read Running code from pull requests, then opt in:
- uses: anthropics/claude-code-action@v1
with:
allow_fork_prs: "true"Without that, the action skips a pull request whose branch is in another repository, or in a fork that was deleted. It does so for every event that names the pull request, including comments on the conversation, whoever opened the pull request and whether it is open or closed. It also skips workflow_run events for a fork's run. It logs a warning, checks nothing out and doesn't start Claude, and the step succeeds without Claude's outputs, so a required check that only runs the action passes without a review. A later step that needs the action's outputs has to handle empty ones. Any value other than true turns forks off, including an empty one.
Where a fork's event comes with credentials, the action first checks write access and, for a bot, allowed_bots, and a run that those checks refuse fails instead of being skipped. This covers comments on the conversation, pull_request_target and workflow_run, and in a private repository other events that get a token or the Anthropic secrets.
For a comment on the conversation that triggers it, the action asks GitHub where the branch is, after it has checked the commenter's write access. It does so for pull requests from your own repository too, so the token needs pull-requests: read. If the answer can't be read, the run fails before anything is checked out.
This covers what the action does with the event that started it. It doesn't cover:
- Other steps. A step that checks out a fork's code, such as
actions/checkoutwith the head of apull_request_targetevent, does so before the action can refuse. A step after the action still runs. - Events that don't name a pull request, such as
issues,workflow_dispatch,repository_dispatchandschedule. Aworkflow_runevent is judged by the run right before it, so one that follows a comment's run, or anotherworkflow_run, counts as yours. - Commands in a session. On an issue, for example, Claude could fetch a fork's commits with commands that you allow or that auto mode's review passes, such as
gitorgh. - Commits already in your repository, such as a
pr-Nbranch from an earlier run, or a fork's commits that someone pushed to a branch of yours. - Text. Issues and comments from outside contributors still reach Claude.
Upgrading: allow_fork_prs used to default to true. Workflows that use a floating tag or branch such as @v1 or @main get the new default without changing anything. If yours relied on Claude working on pull requests from forks, including your team's own forks, or on workflow_run events for a fork's run, set allow_fork_prs: "true". This is needed with allowed_non_write_users too. Otherwise, a required check on those pull requests can now pass without Claude having run. If you already set it to "false", runs with credentials that the write and bot checks refuse now fail where they used to be skipped. If it runs on comments on pull requests with a token of its own, check that the token has pull-requests: read.
A command that runs repository code (npm install, bun test, make) runs whatever the checkout contains, in a job that holds your workflow's tokens. Tag mode checks out the pull request's head, so on a pull request from an outside contributor that code is theirs, even when a maintainer triggered the run.
By default, when the pull request's author does not have write access, the action denies commands that commonly run repository code (package managers, test runners, interpreters and shells), even if claude_args allows them. Claude can still read and edit files, commit and push. Bots count as authors without write access, even if they are listed in allowed_bots, and if the check fails the author is treated the same way. Issues and pull requests from authors with write access are not affected. Runs on workflow_run, workflow_dispatch, repository_dispatch and schedule events are not covered, so follow the checkout guidance above if those check out pull request code. On a closed or merged pull request, tag mode works from the base branch rather than the pull request's code, so nothing is denied.
- This is a list of common commands, not a sandbox. A rule such as
Bash(./scripts/test.sh)stays allowed, and the action logs a warning with the number ofBashrules inclaude_argsthat the list does not cover. Rules in thesettingsinput or settings files are not checked. Other ways of writing a command, such asgit --no-pager -c, may not match the list. Add your own rules with--disallowedToolsif they can run pull request code. - Trust follows the pull request's author. If someone with write access opens a pull request from another person's branch, or pushes someone else's commits, that code is treated as theirs. Review it before asking Claude to run it.
- Commands outside the list follow your permission mode. With
--permission-mode auto, a command that no rule covers runs only if Claude Code's safety review passes it, which we recommend where it is available. In the modes that ask for approval, such a command is denied, because a workflow has no one to approve it. Either way, a rule in--allowedToolsskips that decision, so don't rely on the review for commands you allow. Ifclaude_argsturns off permission checks, for example withbypassPermissions, commands outside the list run without approval, and the action logs a warning. - Text can still steer Claude. On an issue or a trusted author's pull request these commands stay allowed, so text from an outside contributor could try to get Claude to edit a file and then run it. Keep the rules you grant in
claude_argsas narrow as you can. - Other broad rules weaken the protections.
Writelets Claude write outside the workspace, andBash(git:*)can still run programs through forms this list does not deny, such asgit rebase --exec. Avoid them in workflows that handle outside contributions.
Pushes on pull requests from forks: with allow_fork_prs: "true", in tag mode on an open pull request from a fork, Claude pushes to pr-N in your repository. That branch holds the fork's commits as well as Claude's, and GitHub's limits on runs from forks don't apply to it. A workflow or other CI that builds it runs the contributor's code and can have your secrets.
- Keep
pr-*out of CI that holds secrets, for example withbranches-ignore: ["pr-*"]onpushtriggers, and check CI outside GitHub too. - Don't deploy or release from
pr-N. Review the fork's commits before you merge the branch or open a pull request from it, and delete it when you are done. - To stop Claude's pushes in a workflow, on all pull requests and issues, add
--disallowedTools "Bash(git push:*)"toclaude_args. Withuse_commit_signing, also denymcp__github_file_ops.
Getting test results: if you allow pull requests from forks, run their tests in a separate pull_request workflow that needs no secrets, and let Claude read the outcome. The pull request's code then runs outside the job that holds Claude's tokens, which is not the case with restrict_untrusted_prs: false.
- In the test workflow, set
permissions: contents: read. GitHub also limits the token to read access and withholds secrets on pull requests from forks of a public repository. That limit is the real protection, because a pull request can edit the workflow file. - Set your repository to require approval for all external contributors. Review the changes, including workflow files, and then approve the runs. GitHub doesn't ask for approval on pull requests from members of your organization.
- In Claude's workflow, add
actions: readto the job'spermissions. In tag mode, Claude can then see the pull request's workflow runs and their results. - When the runs finish, mention
@claudein a comment on the pull request's conversation. Mentions in reviews don't work on pull requests from forks, because GitHub gives those runs no credentials.
Treat what Claude reports as a pointer to the run. Results are for the latest commit on the pull request, so they don't cover edits Claude makes. A run with the conclusion action_required is waiting for approval and has neither passed nor failed. A pull request can also change what a workflow does and what it is called.
Job logs, and job and step names, are text the pull request controls. To turn off the tools that read them, add --disallowedTools "mcp__github_ci__download_job_log,mcp__github_ci__get_workflow_run_details" to claude_args. Claude may still reach logs through other commands that you allow or that auto mode's review passes, such as gh.
Bots often open pull requests from branches in your own repository. Runs there usually need no approval and can get secrets, so these steps don't protect you in that case.
Upgrading: workflows that use a floating tag or branch such as @v1 or @main get this behavior without changing anything. If a workflow relied on commands like npm test running on pull requests from outside contributors or bots, those commands are now denied, Claude's config and tool config come from your default branch or base_branch even if the pull request targets another branch, as described above, Git LFS files from the pull request stay pointer files if they aren't downloaded yet, and a cd no longer carries over to the next Bash command. The run still succeeds, so check the log for the warning. Set restrict_untrusted_prs: false to turn this off.
Steps that run after Claude, including post steps such as actions/checkout's cleanup, trust GITHUB_ENV, GITHUB_PATH and git's config files, and the action's own outputs in GITHUB_OUTPUT. When the session ends, the action restores those files, including config pulled in through include.path, to how they were before it started, and logs a warning naming any it changed. A session therefore can't pass environment variables to later steps through GITHUB_ENV, and git config changes it made, such as the upstream that git push -u records, don't last. Use --json-schema to pass results on. What a session writes to GITHUB_OUTPUT is dropped, because the action passes on only its own outputs. What a session writes to GITHUB_STEP_SUMMARY is kept, unless it replaced the file with a link or something else that isn't a file.
While Claude runs, and for the action's own git commands afterwards, git ignores core.fsmonitor. Git hooks are off for the action's own commits after the session, and from before the checkout on pull requests that restrict_untrusted_prs applies to. During the session these are set in the repository's git config and by the wrapper scripts. Global git config also sets safe.bareRepository=explicit for the session, so git won't use a repository it finds in a folder that has no .git. A workflow that has Claude work in a bare repository needs to pass --git-dir. If a run is killed before it restores this, the setting stays in the global config of a self-hosted runner that keeps its home directory. Git LFS uploads through a hook, so the action uploads objects itself for its own commits, but a push Claude makes on such a pull request won't include them.
The action's own git commands use safe.bareRepository=explicit too. If the action starts in a bare repository, it doesn't set this before the session, unless restrict_untrusted_prs applies. On pull requests that restrict_untrusted_prs applies to, the action also checks out the pull request with GIT_LFS_SKIP_SMUDGE=1, so files that Git LFS hasn't downloaded yet stay as pointer files. The variable is set for that checkout only.
Claude's wrapper scripts for git add, git rm, git commit and git push always work on the repository the action checked out, and take only a short list of flags, so git add -f is refused. They ignore settings from the environment: GIT_SSH_COMMAND, GIT_ASKPASS, GIT_CONFIG_*, any other GIT_* variable except the author and committer ones, XDG_CONFIG_HOME, and a HOME changed during the session. A workflow that relies on one of those, such as pushing over SSH with GIT_SSH_COMMAND, can allow its own command in claude_args, such as Bash(git push:*), which gives up these protections for that workflow.
This has limits:
- It is not a sandbox. Code running on the runner, for example through an allowed
npm test, can stop the action before it restores anything, or change the files later steps run, including the code of this and other actions. An allow rule forWritecan reach those files too, so treat it like allowing code to run. - When a run is cancelled or times out during the session, the action stops Claude and what it started, restores these files and has the app token revoked. Later
always()and post steps still run, the tracking comment isn't updated, and buffered inline comments aren't posted. Processes that run as another user or no longer belong to one that Claude started keep running, and on Windows Claude itself can too. Nothing is restored or revoked when the action doesn't get the runner's signal, as in a job withcontainer:, or can't react before the runner kills it, as during a longgit fetch. - Submodule config, a repository checked out to a subdirectory, and an
include.pathtarget that does not exist yet are not restored. - The git settings need git 2.31 or newer, and
safe.bareRepositoryneeds 2.38. On older versions they have no effect.
claude-code-base-action is a lower-level building block that installs and runs Claude Code with the inputs you provide. It does not perform actor permission checks, refuse pull requests from forks, restrict commands on pull requests from outside contributors, or restore project configuration from the base ref. If you need those behaviors, use this action (claude-code-action). See the base-action README for details.
In its default configuration, Claude does not create pull requests automatically when responding to @claude mentions. Instead:
- Claude commits code changes to a new branch, or to the pull request's branch, through wrapper scripts in the action. A deny rule for
git add,git rm,git commitorgit pushinclaude_argsalso covers those scripts, including a narrower rule such asgit add -A:*. A deny rule in a settings file doesn't, so pass it inclaude_args - Claude's push command can't update any other branch. For a pull request from a fork, with
allow_fork_prs: "true", its branch ispr-Nin your repository, which also holds the fork's commits, and the fork's branch is not updated - Branch protection on your default branch is still worth having: a workflow can allow other push commands, and a pull request opened from the default branch has that branch as its own
- Claude provides a link to the GitHub PR creation page in its response
- The user must click the link and create the PR themselves, ensuring human oversight before any code is proposed for merging
This design ensures that users retain full control over what pull requests are created and can review the changes before initiating the PR workflow.
Beware of potential hidden markdown when tagging Claude on untrusted content. External contributors may include hidden instructions through HTML comments, invisible characters, hidden attributes, or other techniques. The action sanitizes content by stripping HTML comments, invisible characters, markdown image alt text, hidden HTML attributes, and HTML entities, but new bypass techniques may emerge. We recommend reviewing the raw content of all input coming from external contributors before allowing Claude to process it.
On public repos, you can also use include_comments_by_actor to allowlist which users' comments are passed to Claude, reducing exposure to untrusted input. Use exclude_comments_by_actor to filter out noisy bot comments (e.g., dependabot[bot], renovate[bot]). If an actor matches both lists, exclusion takes priority. See Usage for details.
By default the action uses auto mode, where a safety review decides tool calls that your allow rules don't cover. It catches many unsafe actions, but a call can still run if the review passes it. For a strict list of what Claude may run, use --permission-mode acceptEdits or default.
The Claude Code GitHub app requests the following permissions:
- Contents (Read & Write): For reading repository files and creating branches
- Pull Requests (Read & Write): For reading PR data and creating/updating pull requests
- Issues (Read & Write): For reading issue data and updating issue comments
The following permissions are requested but not yet actively used. These will enable planned features in future releases:
- Discussions (Read & Write): For interaction with GitHub Discussions
- Actions (Read): For accessing workflow run data and logs
- Checks (Read): For reading check run results
- Workflows (Read & Write): For triggering and managing GitHub Actions workflows
By default, commits made by Claude are unsigned. You can enable commit signing using one of two methods:
This uses GitHub's API to create commits, which automatically signs them as verified from the GitHub App:
- uses: anthropics/claude-code-action@main
with:
use_commit_signing: trueThis is the simplest option and requires no additional setup. However, because it uses the GitHub API instead of git CLI, it cannot perform complex git operations like rebasing, cherry-picking, or interactive history manipulation.
With prompt, a run on an issue commits to issue-N. A run on a pull request commits to the pull request's branch, or to pr-N if that branch isn't known to be in this repository. issue-N and pr-N start from the base branch. To use another branch, set CLAUDE_BRANCH in the step's env.
This uses an SSH key to sign commits via git CLI. Use this option when you need both signed commits AND standard git operations (rebasing, cherry-picking, etc.):
- uses: anthropics/claude-code-action@main
with:
ssh_signing_key: ${{ secrets.SSH_SIGNING_KEY }}
bot_id: "YOUR_GITHUB_USER_ID"
bot_name: "YOUR_GITHUB_USERNAME"Commits will show as verified and attributed to the GitHub account that owns the signing key.
Setup steps:
-
Generate an SSH key pair for signing:
ssh-keygen -t ed25519 -f ~/.ssh/signing_key -N "" -C "commit signing key"
-
Add the public key to your GitHub account:
- Go to GitHub → Settings → SSH and GPG keys
- Click "New SSH key"
- Select Key type: Signing Key (important)
- Paste the contents of
~/.ssh/signing_key.pub
-
Add the private key to your repository secrets:
- Go to your repo → Settings → Secrets and variables → Actions
- Create a new secret named
SSH_SIGNING_KEY - Paste the contents of
~/.ssh/signing_key
-
Get your GitHub user ID:
gh api users/YOUR_USERNAME --jq '.id' -
Update your workflow with
bot_idandbot_namematching the account where you added the signing key.
Note: If both ssh_signing_key and use_commit_signing are provided, ssh_signing_key takes precedence.
CRITICAL: Never hardcode your Anthropic API key or OAuth token in workflow files!
Your authentication credentials must always be stored in GitHub secrets to prevent unauthorized access:
# CORRECT ✅
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# OR
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# NEVER DO THIS ❌
anthropic_api_key: "sk-ant-api03-..." # Exposed and vulnerable!
claude_code_oauth_token: "oauth_token_..." # Exposed and vulnerable!The show_full_output option is disabled by default for security reasons. When enabled, it outputs ALL Claude Code messages including:
- Full outputs from tool executions (e.g.,
ps,env, file reads) - API responses that may contain tokens or credentials
- File contents that may include secrets
- Command outputs that may expose sensitive system information
These logs are publicly visible in GitHub Actions for public repositories!
Full output is automatically enabled when GitHub Actions debug mode is active (when ACTIONS_STEP_DEBUG secret is set to true). This helps with debugging but carries the same security risks.
Only enable show_full_output: true or GitHub Actions debug mode when:
- Working in a private repository with controlled access
- Debugging issues in a non-production environment
- You have verified no secrets will be exposed in the output
- You understand the security implications
For debugging, prefer using show_full_output: false (the default) and rely on Claude Code's sanitized output, which shows only essential information like errors and completion status without exposing sensitive data.