Skip to content

feat(action): allow runner npm configuration during CLI installation - #2557

Open
Muzzy5150 wants to merge 11 commits into
openai:mainfrom
Muzzy5150:fix/2407-runner-npm
Open

Muzzy5150 wants to merge 11 commits into
openai:mainfrom
Muzzy5150:fix/2407-runner-npm

Conversation

@Muzzy5150

@Muzzy5150 Muzzy5150 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Trusted Linux runners can now select their npm configuration and custom CA for the pinned CLI installation with use-runner-npm-config: true. This supports registries that require runner-managed authentication or certificate trust. Fixes #2407.

Changes

  • Read NPM_CONFIG_USERCONFIG and NODE_EXTRA_CA_CERTS when the input is enabled. Each supplied path must be absolute and resolve to a regular file.
  • Give those settings to the npm ci subprocess. The selected npm configuration may choose the registry. The installer uses the committed lockfile, disables lifecycle scripts, and has a private cache and global configuration.
  • Build scan, worker, and sandbox-probe environments separately from the installer environment.

AI assistance: Codex was used to inspect the issue and repository, implement and test the change, review the final diff, and draft this pull request. The contributor reviewed the resulting code, public artifacts, and test results before submission.

Testing

On Linux x64 with Node 24, npm run validate passed typechecking, all 230 Action tests, metadata and documentation checks, and bundle reproducibility. The installer fixture exercised the default, user-config only, CA only, and combined settings. It checked the npm command, installer environment, scan environment, and cleanup.

An independent contributor previously exercised real npm against an authenticated loopback HTTPS registry. The original contributor’s installed-CLI smoke test reached Bubblewrap and stopped when the VM kernel denied user namespace creation.

Risk and rollout

The input defaults to false. Opted-in workflows trust the selected npm and CA files during installation. A configuration that expands a token from the environment needs an alternative credential source because the installer does not inherit ambient npm tokens.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Nov 10, 2026

cjc0013 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Independent check at e6f9ff2e6f1349c0fa18bfdc4544f1eddca92ad8: as a complement to the existing synthetic npm fixture, I exercised real Node/npm against a fresh authenticated loopback HTTPS registry.

Installation succeeded only when both the forwarded user configuration and CA certificate were present. With neither configured or authentication only, TLS failed before HTTP. With the CA only, the registry received one unauthenticated request and returned 401.

In the successful case, lifecycle scripts remained disabled and neither configuration path appeared in the scanner environment. The checked-out runtime source and lockfile remained unchanged, and no external registry was contacted.

This is loopback-only validation; it does not establish Socket Registry Firewall or general enterprise-registry compatibility.

@Muzzy5150

Copy link
Copy Markdown
Contributor Author

Thanks for independently validating this against an authenticated HTTPS registry. The TLS/auth matrix and confirmation that lifecycle scripts and scan-environment isolation remained intact are especially helpful.

@mldangelo-oai mldangelo-oai changed the title fix(action): support trusted runner npm config feat(action): allow runner npm configuration during CLI installation Nov 13, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed bug Something isn't working labels Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Merged the inventory test fixture from #2678 into ef1c1555. The two Ubuntu 26.04 tests had failed at the wrapper-ran assertion. Both now pass with the symlink named env, and shard 6 finished with zero failures. Failing shard · Passing shard

I also checked registry selection with real npm and a synthetic lockfile whose tarball URL used registry.npmjs.org. With the opt-in enabled, npm fetched the package from an authenticated loopback HTTPS mirror under /repository/npm/. The file-backed credential and CA together succeeded. A config that relied on ${NODE_AUTH_TOKEN} received HTTP 401, as expected for the isolated installer. The hosted validation job on this head passed the packaged Linux sandbox smoke test, pinned CLI installation, and SARIF compatibility check. Hosted validation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Action: support runner-managed npm authentication and CA configuration during CLI installation

4 participants