fix(deploy): export HOME before writing the registry .npmrc #503
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!503
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/registry-npmrc-home"
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?
Main is red and it is my fault. #499's registry-auth block does not work:
(
Deploy ForgeGraf / test, tasks 24652 / 24665 / 24667)The token is not missing —
FG_REGISTRY_TOKENexists as a repo Actions secret and the step declares it. The block writes to"$HOME/.npmrc"in steps that never export HOME. This same workflow's other steps already carry the fix and even explain it:# unset in runner host jobs. With HOME empty the token lands in/.npmrcwhile pnpm resolves config against the passwd home, so the write succeeds and the auth never applies.Worse, it fails silently: the
[ -n "${FG_REGISTRY_TOKEN:-}" ]guard passes, so the::warning::FG_REGISTRY_TOKEN unsetbranch never fires. Nothing in the log says the token was dropped — only the 401 downstream.Adds the same
export HOME="${HOME:-$(getent passwd "$(id -u)" | cut -d: -f6)}"line the sibling steps use, before all three auth blocks (both installs indeploy.yml, one indeploy-staging.yml). Verified HOME precedes the.npmrcwrite at every site and both files still parse.Why the deploy job passed while test failed
Deploy ForgeGraf / deploysucceeded on the same commit. Its runner's pnpm store was warm, so the tarball fetch never happened. That masks the bug rather than avoiding it — the next cold deploy hits the same 401, anddeploy.yml's ownrm -rf node_modulesguarantees a cold install eventually.Unrelated, worth knowing
@preflight/runreport@0.1.1is now published (preflight-app #22), fixing the ESM defect where the publisheddistused extensionless specifiers Node cannot resolve. Main's lockfile still pins0.1.0; the^0.1.0range permits 0.1.1, so a relock picks it up. Not urgent — the OpenNext build tolerated 0.1.0 — but it removes a latent failure that only bites where the real ESM resolver is used.