diff --git a/.changeset/sunny-moons-appear.md b/.changeset/sunny-moons-appear.md new file mode 100644 index 00000000..f3472e81 --- /dev/null +++ b/.changeset/sunny-moons-appear.md @@ -0,0 +1,5 @@ +--- +"@changesets/action": patch +--- + +Fix root action double error logs diff --git a/src/index.ts b/src/index.ts index ce032292..63e458c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,13 @@ import { validateChangesetsCliVersion, } from "./utils.ts"; -(async () => { +try { + await main(); +} catch (err) { + core.setFailed((err as Error).message); +} + +async function main() { const cwd = getOptionalInput("cwd") || process.cwd(); await validateChangesetsCliVersion(cwd); @@ -131,7 +137,4 @@ import { return; } } -})().catch((err) => { - core.error(err); - core.setFailed(err.message); -}); +}