Dashboard › craft › Craft npm target OIDC detection via CI …
019c9f57-aa11-74f6-9532-7c8a45fe12a5| Project | Hits | Last recalled |
|---|---|---|
| opencode-lore | 2 | 2026-07-17 |
The isOidcEnvironment() helper in src/targets/npm.ts detects OIDC capability by checking CI-specific env vars that npm itself uses for OIDC token exchange: - GitHub Actions: ACTIONS_ID_TOKEN_REQUEST_URL AND ACTIONS_ID_TOKEN_REQUEST_TOKEN (both present when id-token: write permission is set) - GitLab CI/CD: NPM_ID_TOKEN (present when id_tokens with aud: "npm:registry.npmjs.org" is configured) This auto-detection means zero config changes for the common case. The explicit oidc: true config is only needed to force OIDC when NPM_TOKEN is also set (e.g., migration period).