Skip to content

ci(publish): set NODE_AUTH_TOKEN for install and allow manual dispatch - #1317

Closed
vitorrgg wants to merge 1 commit into
masterfrom
ci/publish-use-local-lerna
Closed

vitorrgg wants to merge 1 commit into
masterfrom
ci/publish-use-local-lerna

Conversation

@vitorrgg

@vitorrgg vitorrgg commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Problema

O workflow Publish falhou nas 3 execuções do release de 21/09 (storefront-app@2.0.0-beta.229, storefront-template@2.0.0-beta.301, storefront-renderer). Consequência: o @ecomplus/storefront-app@2.0.0-beta.229 (fix #1314 do checkout) não está no npm, latest continua beta.228.

Causa: o npm i abortou logo no início com

Error: Failed to replace env in config: ${NODE_AUTH_TOKEN}

O setup-node grava um .npmrc com ${NODE_AUTH_TOKEN} e, a partir da v7 (#1300, agosto), deixou de exportar um valor placeholder para os passos seguintes. O npm 6 do Node 14 aborta quando a variável não existe. No último publish bem-sucedido (31/07, setup-node@v6) o passo npm i tinha NODE_AUTH_TOKEN: XXXXX… no env. Sem node_modules, o npx lerna run caiu no lerna global (latest) do runner, que exige Node 18+ e quebrou com Cannot read property 'startsWith' of undefined.

Mudança

  • NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} no env do job (o passo de publish já usava o mesmo secret).
  • ./node_modules/.bin/lerna run ... em vez de npx lerna run ....
  • workflow_dispatch com input package para reexecutar a publicação de um pacote sem re-taguear. O evento registry_package segue funcionando como antes.

Depois do merge

gh workflow run publish.yml --repo ecomplus/storefront -f package=storefront-app
gh workflow run publish.yml --repo ecomplus/storefront -f package=storefront-template
gh workflow run publish.yml --repo ecomplus/storefront -f package=storefront-renderer

🤖 Generated with Claude Code

The Publish workflow failed for every package of the 2026-09-21 release
(storefront-app 2.0.0-beta.229, storefront-template 2.0.0-beta.301,
storefront-renderer). `npm i` aborted right away with
"Failed to replace env in config: ${NODE_AUTH_TOKEN}": setup-node writes
`.npmrc` referencing that variable and, since v7 (#1300), no longer
exports a placeholder value for later steps, so npm 6 on Node 14 bails
out. With no node_modules, `npx lerna` then fell back to the runner's
global latest lerna, which crashed on Node 14.

Set NODE_AUTH_TOKEN at the job level, run the repo's lerna bin
explicitly, and add a `workflow_dispatch` input so a failed publish can
be retried for one package without re-tagging.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vitorrgg
vitorrgg force-pushed the ci/publish-use-local-lerna branch from 0e8f5af to 1a154f3 Compare September 22, 2026 02:44
@vitorrgg vitorrgg changed the title ci(publish): use the repo's lerna and allow manual dispatch ci(publish): set NODE_AUTH_TOKEN for install and allow manual dispatch Sep 22, 2026
@leomp12

leomp12 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Fechando: o 5cbed4d já entrou no master com o mesmo fix (NODE_AUTH_TOKEN no env do job e workflow_dispatch). As 4 execuções do Publish por dispatch depois dele passaram, mantendo o npx lerna. Obrigado pelo diagnóstico, foi ele que destravou a publicação da beta.229.

@leomp12 leomp12 closed this Sep 22, 2026
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.

2 participants