Skip to content

Commit

Permalink
Ensure publish job has correct status on fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 4, 2024
1 parent 498d294 commit dedbcde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/publish-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const cwd = process.cwd()
}
}

await Promise.allSettled(
const results = await Promise.allSettled(
packageDirs.map(async (packageDir) => {
const pkgJson = JSON.parse(
await fs.promises.readFile(
Expand All @@ -172,5 +172,9 @@ const cwd = process.cwd()
})
)

if (results.some((item) => item.status === 'rejected')) {
console.error(`Not all packages published successfully`, results)
process.exit(1)
}
await undraft()
})()

0 comments on commit dedbcde

Please sign in to comment.