You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After PR #1132 was merged (commit 32156b1), git fetch fails with authentication error when allowed_non_write_users is configured. The new credential helper approach sets GH_TOKEN in the Node.js process env, but the subprocess env scrub (CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1), which is automatically enabled when allowed_non_write_users is set, strips GH_TOKEN from subprocess environments — making the credential helper unable to authenticate.
The root cause is in git-config.ts: when ALLOWED_NON_WRITE_USERS is truthy, the action uses a credential helper that reads $GH_TOKEN at auth time. But CLAUDE_CODE_SUBPROCESS_ENV_SCRUB (auto-set to 1 by the same condition) removes GH_TOKEN from subprocess environments, so git fetch via the credential helper fails.
To Reproduce
Configure workflow with allowed_non_write_users: '*'
Open a PR from a non-write user
Action triggers, credential helper is configured successfully
Action attempts git fetch origin <branch> --depth=1 to restore .claude, .mcp.json, etc.
fatal: Authentication failed — credential helper returns empty password because $GH_TOKEN is scrubbed
Expected behavior
git fetch should succeed using the credential helper, as it did before PR #1132 when the token was embedded directly in the remote URL.
Screenshots
Configuring git credential helper...
✓ Configured credential helper
Git authentication configured successfully
Installing Claude Code v2.1.89...
✅ Installation complete!
Claude Code installed successfully
Restoring .claude, .mcp.json, .claude.json, .gitmodules, .ripgreprc from origin/master (PR head is untrusted)
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/<org>/<repo>.git/'
Error: Action failed with error: Command failed: git fetch origin master --depth=1
Error: Process completed with exit code 1.
The conflict: allowed_non_write_users != '' triggers both the credential helper path in git-config.ts AND sets CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 — these two features are incompatible since the credential helper needs GH_TOKEN in the subprocess env
Possible fix: exempt GH_TOKEN from env scrub, or fall back to URL-embedded token for the action's own git fetch operations (not Claude's subprocesses)
Describe the bug
After PR #1132 was merged (commit
32156b1),git fetchfails with authentication error whenallowed_non_write_usersis configured. The new credential helper approach setsGH_TOKENin the Node.js process env, but the subprocess env scrub (CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1), which is automatically enabled whenallowed_non_write_usersis set, stripsGH_TOKENfrom subprocess environments — making the credential helper unable to authenticate.The root cause is in
git-config.ts: whenALLOWED_NON_WRITE_USERSis truthy, the action uses a credential helper that reads$GH_TOKENat auth time. ButCLAUDE_CODE_SUBPROCESS_ENV_SCRUB(auto-set to1by the same condition) removesGH_TOKENfrom subprocess environments, sogit fetchvia the credential helper fails.To Reproduce
allowed_non_write_users: '*'git fetch origin <branch> --depth=1to restore.claude,.mcp.json, etc.fatal: Authentication failed— credential helper returns empty password because$GH_TOKENis scrubbedExpected behavior
git fetchshould succeed using the credential helper, as it did before PR #1132 when the token was embedded directly in the remote URL.Screenshots
Workflow yml file
API Provider
Additional context
@v17225f04(before Add subprocess isolation setup and git credential helper #1132) resolves the issueallowed_non_write_users != ''triggers both the credential helper path ingit-config.tsAND setsCLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1— these two features are incompatible since the credential helper needsGH_TOKENin the subprocess envGH_TOKENfrom env scrub, or fall back to URL-embedded token for the action's owngit fetchoperations (not Claude's subprocesses)