Repository navigation
ci: authenticate GitHub Packages installs when the app opts in - #16
Merged
Merged
Conversation
setup-app now checks the app's .npmrc. When it routes a scope to https://npm.pkg.github.com, setup-app appends the //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} placeholder to ~/.npmrc and reports github-packages=true. The install steps in app-ci-checks and build-app then set NODE_AUTH_TOKEN to github.token. Apps that route nothing there see no change: no auth line, and an empty token in the install environment. Contract change: every installing job (format-n-lint, pnpm-audit, and the build jobs in app-build-deploy-dev and app-build-deploy-release) now requests packages: read. A called job cannot request more than its caller grants, so each caller must add packages: read before this merges, or its next run fails at startup. The README permission table, examples and consumer rules are updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vAMiNPVaNSZvobuesTQnA
Drop the paragraph about the AUTHORIZED_DEPLOYERS gate and releasing the tag first. The notification fires on `released`, so the tag is already the latest release, and the promote workflow enforces the gate itself. The headline now says the release is deployed to staging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vAMiNPVaNSZvobuesTQnA
gregory-kf
approved these changes
Sep 29, 2026
ARR552
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets an app install packages from GitHub Packages in its pipeline, starting with the
@centrifuge/sdk-internalsnapshots that centrifuge/backend#625 publishes there.What changes
actions/setup-appreads the app's.npmrc. If it routes a scope, or the default registry, tohttps://npm.pkg.github.com, it://npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}to~/.npmrc, the same line backend's own setup action writes (backend/.github/actions/setup/action.yml#L14-L21);github-packages=true.Otherwise it writes nothing and outputs
false. Only the placeholder is written, so the token never lands on disk.Install steps in
app-ci-checks.yml(format-n-lintandpnpm-audit) and inactions/build-appsetNODE_AUTH_TOKENtogithub.tokenwhen that output istrue, and to an empty string otherwise.github.tokenis the run's automatic token. No secret is added anywhere.Permissions:
format-n-lint,pnpm-audit, and thebuildjobs inapp-build-deploy-dev.ymlandapp-build-deploy-release.yml(includingbuild-demo) now requestpackages: read. This is the contract change above.README: permission table, both caller examples, and a new consumer rule.
Why the app's
.npmrcis the switchThe routing already has to live there, so the opt-in follows it and needs no new inputs across three workflows. An app that routes nothing to GitHub Packages gets no auth line and an empty token, exactly as today. Both apps' current
.npmrcfiles evaluate tofalse.Both apps are on pnpm 10.10, so they route with a scope mapping. The per-package
gh:prefix backend uses for@centrifuge/protocol-eventsneeds pnpm 11.20 (backend/docs/docker-images.md#L83), and this detection does not look for it.A pnpm step that runs after the install (a build or verify script) logs
Failed to replace env in config: ${NODE_AUTH_TOKEN}in opted-in apps, because the token is only in the install step's environment. Backend CI shows the same warning. It is harmless, and exporting the token job-wide to silence it would hand it to every later step.Also in this PR: shorter production-promotion message
The Slack message
notify-production-promotionposts onreleaseddrops the paragraph about theAUTHORIZED_DEPLOYERSgate and releasing the tag first. The message fires onreleased, so the tag is already the latest release, andapp-promote-production.ymlenforces the gate itself. The job step summary is unchanged. Rendered for invest-v3:No input or caller change.
Rollout
@centrifuge:registry=https://npm.pkg.github.comto.npmrc, and install"@centrifuge/sdk": "npm:@centrifuge/sdk-internal@0.0.0-sha-<commit>".Step 4 in
CLAUDE.md("point one app caller at your branch") does not exercise this change by itself: the reusable workflows callsetup-app@mainandbuild-app@main, so a caller pinned to this branch still runs the old composite actions.Verification
actionlint1.7.7 andyamllint(relaxed, line-length disabled) clean across.githubandactions.shellcheckclean on the newsetup-appscript. The single quotes around the placeholder are deliberate and annotated.npm.pkg.github.com.evil.example,npm.pkg.github.comx). Plus both apps' current.npmrc, which stayfalse.printfblock with invest-v3 values.🤖 Generated with Claude Code
https://claude.ai/code/session_014vAMiNPVaNSZvobuesTQnA