Skip to content

Commit

Permalink
fix(publishing-bumped-packages): look for status code instaead of stderr
Browse files Browse the repository at this point in the history
Summary:
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

Differential Revision: D42836212

fbshipit-source-id: 8dfaa05c552589c9deac1a8184c14017d13bfdf3
  • Loading branch information
hoxyq authored and facebook-github-bot committed Jan 30, 2023
1 parent 8d5f880 commit e5597b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/monorepo/find-and-publish-all-bumped-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ const findAndPublishAllBumpedPackages = () => {

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

const {stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
const {status} = 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}:`,
);
Expand Down

0 comments on commit e5597b5

Please sign in to comment.