-
Notifications
You must be signed in to change notification settings - Fork 61
[WIP] Fix the failing GitHub Actions workflow agent #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,10 +182,27 @@ if [ -n "$CLAUDE_CODE_API_KEY_HELPER" ]; then | |
| fi | ||
| echo "[entrypoint] ✓ $label apiKeyHelper validated" | ||
| else | ||
| echo "[entrypoint] $label exists but missing apiKeyHelper, writing..." | ||
| echo "{\"apiKeyHelper\":\"$CLAUDE_CODE_API_KEY_HELPER\"}" > "$config_file" | ||
| chmod 666 "$config_file" | ||
| echo "[entrypoint] ✓ Wrote apiKeyHelper to $label" | ||
| echo "[entrypoint] $label exists but missing apiKeyHelper, merging..." | ||
| # Use node to safely add apiKeyHelper to existing JSON without losing other fields | ||
| # (e.g. hasCompletedOnboarding, session tokens, user preferences) | ||
| if AWF_CONFIG_FILE="$config_file" AWF_KEY_HELPER="$CLAUDE_CODE_API_KEY_HELPER" \ | ||
| node -e " | ||
| const fs = require('fs'); | ||
| const file = process.env.AWF_CONFIG_FILE; | ||
| const helper = process.env.AWF_KEY_HELPER; | ||
| let obj = {}; | ||
| try { obj = JSON.parse(fs.readFileSync(file, 'utf8')); } catch(e) {} | ||
| obj.apiKeyHelper = helper; | ||
| fs.writeFileSync(file, JSON.stringify(obj) + '\n'); | ||
| " 2>/dev/null; then | ||
| chmod 666 "$config_file" | ||
| echo "[entrypoint] ✓ Merged apiKeyHelper into $label" | ||
| else | ||
| # Fallback if node is unavailable or the file is not valid JSON | ||
| echo "{\"apiKeyHelper\":\"$CLAUDE_CODE_API_KEY_HELPER\"}" > "$config_file" | ||
| chmod 666 "$config_file" | ||
| echo "[entrypoint] ✓ Wrote apiKeyHelper to $label (overwrite fallback)" | ||
|
Comment on lines
+201
to
+204
|
||
| fi | ||
|
Comment on lines
+193
to
+205
|
||
| fi | ||
| else | ||
| echo "[entrypoint] Creating $label with apiKeyHelper..." | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is fixing a CI blocker by preserving existing Claude Code config fields while adding
apiKeyHelper, but there doesn’t appear to be an automated test that exercises thewrite_api_key_helperbehavior (e.g., pre-seeded ~/.claude.json and ~/.claude/settings.json with additional fields, then verifying they are preserved and apiKeyHelper is set). Adding an integration test for this merge path would help prevent regressions in future entrypoint edits.