mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-08-22 03:18:54 +08:00
Auto-set subprocess env scrub when allowed_non_write_users is configured (#1093)
* Auto-set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB when allowed_non_write_users is configured Sets the env var automatically whenever allowed_non_write_users is non-empty, so downstream workflows don't need to add it manually. Updates the input description and docs/security.md to note the behavior. 🏠 Remote-Dev: homespace * Fall back to inherited env when allowed_non_write_users is unset 🏠 Remote-Dev: homespace * Let workflow/job env override the auto-set scrub flag Env var takes priority so users can opt in/out via CLAUDE_CODE_SUBPROCESS_ENV_SCRUB at job or workflow level independently of allowed_non_write_users. 🏠 Remote-Dev: homespace
This commit is contained in:
+11
-1
@@ -32,7 +32,16 @@ inputs:
|
||||
required: false
|
||||
default: ""
|
||||
allowed_non_write_users:
|
||||
description: "Comma-separated list of usernames to allow without write permissions, or '*' to allow all users. Only works when github_token input is provided. WARNING: Use with extreme caution - this bypasses security checks and should only be used for workflows with very limited permissions (e.g., issue labeling)."
|
||||
description: |
|
||||
Comma-separated list of usernames to allow without write permissions, or '*' to allow all users.
|
||||
Only works when github_token input is provided. WARNING: Use with extreme caution - this
|
||||
bypasses security checks and should only be used for workflows with very limited permissions
|
||||
(e.g., issue labeling).
|
||||
|
||||
SECURITY: Processing untrusted content exposes the workflow to prompt injection. When this
|
||||
input is set, Claude does a best-effort scrub of Anthropic, cloud, and GitHub Actions secrets
|
||||
from subprocess environments. This reduces but does not eliminate prompt injection risk -
|
||||
only use for workflows with very limited permissions and validate all outputs.
|
||||
required: false
|
||||
default: ""
|
||||
include_comments_by_actor:
|
||||
@@ -204,6 +213,7 @@ runs:
|
||||
OVERRIDE_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
ALLOWED_BOTS: ${{ inputs.allowed_bots }}
|
||||
ALLOWED_NON_WRITE_USERS: ${{ inputs.allowed_non_write_users }}
|
||||
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: ${{ env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB || (inputs.allowed_non_write_users != '' && '1') || '' }}
|
||||
INCLUDE_COMMENTS_BY_ACTOR: ${{ inputs.include_comments_by_actor }}
|
||||
EXCLUDE_COMMENTS_BY_ACTOR: ${{ inputs.exclude_comments_by_actor }}
|
||||
GITHUB_RUN_ID: ${{ github.run_id }}
|
||||
|
||||
Reference in New Issue
Block a user