Skip to content

ci(claude): strip+validate OAuth token before auth - #7

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/harden-claude-token
Jun 14, 2026
Merged

ci(claude): strip+validate OAuth token before auth#7
github-actions[bot] merged 1 commit into
mainfrom
ci/harden-claude-token

Conversation

@subkoks

@subkoks subkoks commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Problem

Every @claude Action run fails with API Error: Header '14' has invalid value: '***\n ***' because CLAUDE_CODE_OAUTH_TOKEN was stored with an embedded newline (a wrapped terminal paste).

Fix

Add a Validate & normalize Claude token step to each job that strips whitespace from the secret (healing the value at runtime), fails early with a clear ::error:: if it is missing/malformed, re-masks it, and passes it to the action via env.CLAUDE_OAUTH. actionlint clean.

🤖 Generated with Claude Code

A wrapped paste embeds a newline in CLAUDE_CODE_OAUTH_TOKEN, breaking the auth
header. Strip whitespace (heals the secret at runtime) + fail early, then pass
the normalized token via env.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit b442a95 into main Jun 14, 2026
4 checks passed
@subkoks
subkoks deleted the ci/harden-claude-token branch June 14, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant