Skip to content

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

Open

Description

@lattwood

The GitHub Action fails during CLI installation on an Ubuntu 24.04 Linux x64 runner using Socket Registry Firewall.

The runner provides registry authentication and certificate trust through:

  • NPM_CONFIG_USERCONFIG: a runner-managed npm configuration containing registry authentication.
  • NODE_EXTRA_CA_CERTS: the runner’s registry firewall CA certificate.

We observed this with action-v0.8.3, pinned to 90c85a3617e06eb5b4ac139778ef06581f44e532.

Observed behavior

Sandbox setup and checkout succeed. During CLI preparation, npm exits with:

npm error Exit handler never called!
Integrity-locked CLI installation failed (exit 1).

The scan never reaches model inference.

Inspecting the pinned action shows that:

  1. runtimeEnvironment() constructs a fresh environment without either variable.
  2. The installer creates empty npm user/global configuration files and explicitly passes them to npm ci.
  3. The failure path deletes the temporary runtime directory containing npm’s detailed debug log.

The configuration mismatch is confirmed from the source. We have not confirmed the underlying npm failure as a certificate or authentication error because its detailed log was not retained.

Reproduction conditions

  1. Use a runner whose npm registry access requires runner-provided authentication and a custom CA.
  2. Configure the two variables above through the trusted runner setup.
  3. Run the pinned Codex Security Action after checkout.
  4. Observe the CLI installation failure before scanning starts.

Requested behavior

Provide explicit, opt-in support for trusted runner-managed npm configuration and CA trust during CLI installation:

  • Honor the selected npm configuration through --userconfig; forwarding the environment variable alone cannot override the current explicit argument.
  • Pass the selected CA certificate to the installer subprocess.
  • Keep registry credentials confined to installation, while preserving lockfile integrity checks, disabled lifecycle scripts, and the isolated scan environment.

Sanitized npm failure diagnostics before temporary-directory cleanup would also make these compatibility problems easier to diagnose.

Activity

  1. i098 commented on Nov 11, 2026

    @i098
    Contributor

    I would like to work on this. Before I write code, I want to check the scope.

    On main, runtimeEnvironment() in github-action/src/runtime.ts builds a new environment for the npm ci install step. It does not copy NODE_EXTRA_CA_CERTS, NPM_CONFIG_USERCONFIG, or the proxy variables, so a runner behind a private CA or registry mirror cannot install the CLI.

    I see two options:

    1. Forward only the CA and proxy variables to the install step. The scan environment stays as it is.
    2. Do option 1, and also forward NPM_CONFIG_USERCONFIG, so a private registry or mirror can be used.

    Which scope do you want? I can open a small PR with tests for the option you choose.

  2. mldangelo-oai commented on Nov 15, 2026

    @mldangelo-oai
    Collaborator

    Thanks for offering to work on this. There’s already a patch in #2557 for the installer to opt in to the runner’s npm configuration and CA file. I reproduced the TLS failure with real npm against a local registry and verified that the same install succeeded with the patch. That PR is the place to continue the work. A runner that also needs proxy forwarding would be a useful separate case to test.

  3. added
    bugSomething isn't working
    area:releasePackaging, installers, CI workflows, container distribution, and releases.
    on Nov 15, 2026
  4. i098 commented on Nov 19, 2026

    @i098
    Contributor

    Thanks, that's clear, I'll leave the patch to #2557 and won't open a second one. I'll test #2557 on a runner that also needs a proxy to reach the registry and post what I find on that PR. Please let me know if you'd like a different setup covered.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:releasePackaging, installers, CI workflows, container distribution, and releases.bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions