Skip to content

Commit 9d1ff8d

Browse files
trusted publishing only
1 parent 7e072c2 commit 9d1ff8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/publish-npm.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ const publishPackage = ({ path, name }, shouldPublish) => {
142142
delete npmEnv[key];
143143
}
144144
}
145+
delete npmEnv.NODE_AUTH_TOKEN;
146+
const tempNpmrc = join(tmpdir(), `npmrc-${process.pid}.tmp`);
147+
writeFileSync(tempNpmrc, "");
148+
npmEnv.NPM_CONFIG_USERCONFIG = tempNpmrc;
149+
npmEnv.npm_config_userconfig = tempNpmrc;
145150
console.log(
146151
`npm_config_workspace=${process.env.npm_config_workspace || ""} npm_config_workspaces=${process.env.npm_config_workspaces || ""}`
147152
);
@@ -152,7 +157,7 @@ const publishPackage = ({ path, name }, shouldPublish) => {
152157
const tgzPath = resolve(join(path, tgzName));
153158
console.log(`Packed tarball: ${tgzPath}`);
154159
const publishCwd = mkdtempSync(join(tmpdir(), "rescript-mui-publish-"));
155-
execSync(`npm publish ${tgzPath} --access public --tag ${distTag}`, {
160+
execSync(`npm publish ${tgzPath} --access public --tag ${distTag} --provenance`, {
156161
cwd: publishCwd,
157162
stdio: "inherit",
158163
env: npmEnv,

0 commit comments

Comments
 (0)