Repository navigation
[ci] Extract the internal-registry OIDC exchange into a reusable auth action - #9084
Merged
Merged
Conversation
… 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.
zurfyx
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
potatowagon
as code owners
August 20, 2026 17:25
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Aug 20, 2026
Merged
This branch was successfully deployed
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.
dependency-checkminted 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
authaction.dependency-checkkeeps doing exactly what it did; it just takes the token as an input now.Why an input, and not
uses:the sibling actionA 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:
./.github/actions/innerCan't find 'action.yml' … under '/home/runner/work/<caller>/<caller>/.github/actions/inner'<owner>/<repo>/.github/actions/inner@mainNote 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@refreference does resolve. It is not used here because it would hard-pin one action's version inside the other's, sodependency-check@v2would silently carry a fixedauth, and bumpingauthwould mean re-tagging both. Composing in the workflow keeps the two independently versioned.That is also why
tokenis a required input whose empty value means "skip". The fork-PR branch has to live in the caller's control, becauseauthis the step that discovers there is no OIDC identity.What
authadds beyond the extracted mintThe 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:
.npmrcis invisible tonpm publishrun in a subdirectory — it failsENEEDAUTHwith the credential demonstrably present. It also honoursNPM_CONFIG_USERCONFIG, which is wheresetup-nodepoints npm when given aregistry-url.scopesinput, appended rather than overwritten so asetup-nodeentry that a dual-target publish still needs survives.on-missing-oidc: fail | skip— a checker wants to skip on fork PRs; a publish job wants to fail loudly.python3dependency 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-urldefault.Verification
This PR's own
Internal Registryrun exercises the refactor end to end:So
authmints, masks and hands the token todependency-check, which authenticates and checks the full lockfile. Thewrite-npmrc: 'false'path is confirmed by the absence of any npm config write.The npmrc-writing path and the
scopesinput 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, andnpm viewresolved a scoped package through it.The one failure in this run is
HTTP 502on 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-v1tag keeps working for anything pinned to it. Afterwards two tags are needed —internal-registry-auth-v1, andinternal-registry-dependency-check-v2for the newtokeninput.