fix(ci): strip CR/LF from registry secrets so the push/release steps work #6
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/release-secret-newline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The release run now builds cleanly (both targets) and packages artifacts — it fails at "Commit version bump and push tag":
The
REGISTRY_USERsecret carries a trailing newline (Whitlocktech\n), so the remote URL the step assembles from${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_TOKEN }}is malformed. The release step feeds the same token into acurlAuthorization: tokenheader, which a newline would break too.(The bump commit the runner printed was local only and not pushed; the release step was skipped — origin is clean, no stray tag/commit.)
Fix
Pass the secrets via
env:and strip line breaks before use:Applied in both the push step (remote URL) and the release step (auth header). Using
envinstead of inline${{ }}also prevents a newline from breaking the shell script itself.Verification
REGISTRY_USER=$'Whitlocktech\n'→CI_USER=Whitlocktech→https://Whitlocktech:TOKEN@host/UOM/link.git(single line, valid).Note (still untested downstream)
This unblocks URL/header construction, but the push + tag + release steps have never completed a real run yet. They still require:
REGISTRY_TOKENto havewrite:repositoryscope, andmainto accept a direct push from that CI user (branch-protection exception).If the next run gets past the URL and then 403s on the push, that's the remaining config item — not a workflow bug. Fixing the secret value itself (re-save
REGISTRY_USERwithout a trailing newline) is also worth doing, but this makes the workflow robust regardless.🤖 Generated with Claude Code
The release run built its push URL and auth header directly from `secrets.REGISTRY_USER` / `REGISTRY_TOKEN`. A trailing newline in REGISTRY_USER produced a malformed remote: warning: url contains a newline in its username component fatal: credential url cannot be parsed Pass the secrets through `env:` and strip CR/LF (`tr -d '\r\n'`) before building the URL (push step) and the `Authorization: token` header (release step). Using env instead of inline `${{ }}` also stops a newline from breaking the shell script itself. Verified the file still parses and the trim turns `Whitlocktech\n` into a clean single-line URL. Underlying cause is secret hygiene (the value was saved with a trailing newline); this makes the workflow robust to it either way. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0114TpmrNW4wNXsHq5CR72jQ