Skip to content

fix(ci): add GitHub Packages auth to docs-deploy workflow - #1461

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-fix-docs-deploy-npm-auth
Aug 3, 2026
Merged

fix(ci): add GitHub Packages auth to docs-deploy workflow#1461
jung-thomas merged 1 commit into
mainfrom
worktree-fix-docs-deploy-npm-auth

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The Deploy Docs to GitHub Pages workflow began failing on the merge of #1457 (run):

npm error code E401
npm error 401 Unauthorized - GET https://npm.pkg.github.com/download/@sap-tutorials/cds-alert-notification/1.0.0/... : unauthenticated

Root cause

PR #1457 (ANS integration) added the private GitHub Packages dependency @sap-tutorials/cds-alert-notification and a .npmrc that points @sap-tutorials at npm.pkg.github.com with _authToken=${NODE_AUTH_TOKEN}. It updated 8 workflows (unit-tests, schema-drift-check, api-docs-drift, cds-build-staging-check, e2e-coverage-nudge, regen-alerts-lockfile, srv-qa-cp-list-check, validate-api-docs-yaml) with packages: read + NODE_AUTH_TOKEN on their install steps — but missed docs-deploy.yml, whose npm ci now can't authenticate.

Fix

Mirror the sibling-workflow pattern in docs-deploy.yml:

  • add packages: read to the job permissions
  • set NODE_AUTH_TOKEN: ${{ secrets.PACKAGES_READ_TOKEN || secrets.GITHUB_TOKEN }} on the npm ci step

No other change.

PR #1457 added the private GitHub Packages dependency
@sap-tutorials/cds-alert-notification (+ .npmrc reading ${NODE_AUTH_TOKEN})
and updated 8 workflows with 'packages: read' + NODE_AUTH_TOKEN, but missed
docs-deploy.yml. Its 'npm ci' now fails with E401 Unauthorized against
npm.pkg.github.com.

Mirror the sibling-workflow pattern: grant 'packages: read' and set
NODE_AUTH_TOKEN on the npm ci step.
@jung-thomas
jung-thomas marked this pull request as ready for review August 3, 2026 21:54
@jung-thomas
jung-thomas merged commit 8323418 into main Aug 3, 2026
2 of 3 checks passed
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