Skip to content

Commit 075e5fe

Browse files
committed
OIDC tag
1 parent d64c575 commit 075e5fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/publish.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,15 @@ export async function publish(args) {
407407
else if (args.tag) {
408408
const cmd = `npm dist-tag add ${packageJson.name}@${packageJson.version} ${args.tag}`;
409409
logger.info(`Setting tag '${args.tag}' for package ${packageJson.name}@${packageJson.version} (${cmd})`);
410-
const res = tryExecSync(cmd, {
410+
// For OIDC: don't pass custom env - let npm inherit the full parent environment
411+
// This ensures all OIDC-related env vars are available to npm
412+
const execOptions = {
411413
cwd: packageDirectory,
412-
env: env
413-
});
414+
};
415+
if (!args.useOidc) {
416+
execOptions.env = env;
417+
}
418+
const res = tryExecSync(cmd, execOptions);
414419
if (res.success) {
415420
logger.info(`Successfully set tag '${args.tag}' for package ${packageJson.name}@${packageJson.version}`);
416421
if (webhook) {

0 commit comments

Comments
 (0)