UNPKG

lerna

Version:

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository

26 lines (25 loc) 1.21 kB
/** * Adapted from https://github.com/npm/cli/blob/latest/lib/utils/oidc.js */ import type { Conf } from "./npm-conf/conf"; interface OidcOptions { packageName: string; registry: string; opts: any; config: Conf; } /** * Handles OpenID Connect (OIDC) token retrieval and exchange for CI environments. * * This function is designed to work in Continuous Integration (CI) environments such as GitHub Actions * and GitLab. It retrieves an OIDC token from the CI environment, exchanges it for an npm token, and * sets the token in the provided configuration for authentication with the npm registry. * * This function is intended to never throw, as it mutates the state of the `opts` and `config` objects on success. * OIDC is always an optional feature, and the function should not throw if OIDC is not configured by the registry. * * @see https://github.com/watson/ci-info for CI environment detection. * @see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect for GitHub Actions OIDC. */ export declare function oidc({ packageName, registry, opts, config }: OidcOptions): Promise<undefined>; export {};