Skip to content

[ci] Extract the internal-registry OIDC exchange into a reusable auth action - #9084

Merged
zurfyx merged 1 commit into
mainfrom
internal-registry-auth-action
Aug 20, 2026
Merged

zurfyx merged 1 commit into
mainfrom
internal-registry-auth-action

Conversation

@zurfyx

@zurfyx zurfyx commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

dependency-check minted its own credential inline. Other repositories need the same credential to install and publish, not just to run this check, so the exchange was getting copy-pasted rather than shared.

This splits the mint into a sibling auth action. dependency-check keeps doing exactly what it did; it just takes the token as an input now.

Why an input, and not uses: the sibling action

A local uses: ./... inside a composite action resolves against the caller's workspace, not the repository the action came from. So a remote composite action cannot reference a sibling by local path.

Verified rather than assumed, with throwaway actions in a public repo consumed from a different organization:

the action under test result
plain composite, no nested reference success
composite referencing ./.github/actions/inner Can't find 'action.yml' … under '/home/runner/work/<caller>/<caller>/.github/actions/inner'
composite referencing <owner>/<repo>/.github/actions/inner@main success

Note the path in the failing case: it is the caller's checkout, not the action's.

The third row is the available workaround — a full owner/repo/path@ref reference does resolve. It is not used here because it would hard-pin one action's version inside the other's, so dependency-check@v2 would silently carry a fixed auth, and bumping auth would mean re-tagging both. Composing in the workflow keeps the two independently versioned.

That is also why token is a required input whose empty value means "skip". The fork-PR branch has to live in the caller's control, because auth is the step that discovers there is no OIDC identity.

What auth adds beyond the extracted mint

The inline version was enough for a checker that makes one HTTP call. Making it usable for install and publish needs a few more things, each of which cost real debugging time somewhere:

  • Writes npm user config. npm does not walk up from the directory it publishes from, so a repo-root .npmrc is invisible to npm publish run in a subdirectory — it fails ENEEDAUTH with the credential demonstrably present. It also honours NPM_CONFIG_USERCONFIG, which is where setup-node points npm when given a registry-url.
  • Scope routing via a scopes input, appended rather than overwritten so a setup-node entry that a dual-target publish still needs survives.
  • Masks the credential, which the inline version did not.
  • Logs the OIDC subject. Not a secret, and it is the exact string the registry authorizes against, so an otherwise opaque rejection becomes self-diagnosing.
  • on-missing-oidc: fail | skip — a checker wants to skip on fork PRs; a publish job wants to fail loudly.
  • Drops the python3 dependency the inline version used to parse a single JSON field.

Defaults are unchanged, and nothing about the exchange itself is new — same endpoint, same audiences, same registry-url default.

Verification

This PR's own Internal Registry run exercises the refactor end to end:

Credential minted for subject: repo:facebook/lexical:pull_request
Checking 2709 version(s) across 2206 package(s) against https://registry.facebook.net …

So auth mints, masks and hands the token to dependency-check, which authenticates and checks the full lockfile. The write-npmrc: 'false' path is confirmed by the absence of any npm config write.

The npmrc-writing path and the scopes input were verified separately, by consuming this branch from a repository in a different organization: the scope was routed, the credential landed in the user config, and npm view resolved a scoped package through it.

The one failure in this run is HTTP 502 on a single upstream package — a known intermittent registry issue, not related to this change, and the same check passes on re-run.

Merging

The existing internal-registry-dependency-check-v1 tag keeps working for anything pinned to it. Afterwards two tags are needed — internal-registry-auth-v1, and internal-registry-dependency-check-v2 for the new token input.

… action

The dependency-check action minted its own credential inline. Other
repositories need the same credential to install and publish, so the exchange
was getting copy-pasted rather than shared. Split the mint into a sibling
`auth` action and have dependency-check take the token as an input.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 20, 2026
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Aug 20, 2026 5:25pm
lexical-playground Ready Ready Preview Aug 20, 2026 5:25pm

Request Review

@zurfyx
zurfyx added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit 0539e88 Aug 20, 2026
48 of 49 checks passed
@etrepum etrepum mentioned this pull request Aug 31, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — 02d40925 Deployed Aug 20, 2026 by vercel[bot]
Preview – lexical-playground — 02d40925 Deployed Aug 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants