Skip to content

Commit 77936fa

Browse files
hoxyqkelset
authored andcommitted
fix(publishing-bumped-packages): look for status code instaead of stderr (facebook#36004)
Summary: Pull Request resolved: facebook#36004 Changelog: [Internal] This fixes CircleCI job, which is responsible for publishing bumped packages. We should not check for `stderr`, apparently `npm` uses it to store debug information: - npm/npm#118 (comment) So we've tried to use this on 0.71-stable before and it succesfully published one package, but have exited right after it because `stderr` was not empty Reviewed By: cortinico, cipolleschi Differential Revision: D42836212 fbshipit-source-id: 6f2a9a512121683268fe6aae6a187fccb8d9dfbc
1 parent 76ca8e2 commit 77936fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/monorepo/find-and-publish-all-bumped-packages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ const findAndPublishAllBumpedPackages = () => {
103103

104104
const npmOTPFlag = NPM_CONFIG_OTP ? `--otp ${NPM_CONFIG_OTP}` : '';
105105

106-
const {stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
106+
const {status, stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
107107
cwd: packageAbsolutePath,
108108
shell: true,
109109
stdio: 'pipe',
110110
encoding: 'utf-8',
111111
});
112-
if (stderr) {
112+
if (status !== 0) {
113113
console.log(
114-
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}:`,
114+
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}. npm publish exited with code ${status}:`,
115115
);
116116
console.log(stderr);
117117

0 commit comments

Comments
 (0)