Skip to content

Commit

Permalink
fix(publishing-bumped-packages): look for status code instaead of std…
Browse files Browse the repository at this point in the history
…err (#36004)

Summary:
Pull Request resolved: #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
  • Loading branch information
hoxyq authored and facebook-github-bot committed Jan 30, 2023
1 parent 8056cd7 commit 9856c33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/monorepo/find-and-publish-all-bumped-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ const findAndPublishAllBumpedPackages = () => {

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

const {stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
const {status, stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
cwd: packageAbsolutePath,
shell: true,
stdio: 'pipe',
encoding: 'utf-8',
});
if (stderr) {
if (status !== 0) {
console.log(
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}:`,
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}. npm publish exited with code ${status}:`,
);
console.log(stderr);

Expand Down

0 comments on commit 9856c33

Please sign in to comment.