Skip to content

Commit 40703dc

Browse files
author
Roman Melnikov
committed
fix(dev-workflow): PR #224 test — skip throw when in plan:true mode
P1-3 fix (throw on publish failure) was too eager: it fired even in plan:true mode where package lookup failures are informational during dry-run. Restructured: skip directory lookup entirely in plan mode, treating it as a pure dry-run.
1 parent 1f0abca commit 40703dc

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

packages/dev-workflow/pipelines/release.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,21 @@ const publishFn = defineFunction({
217217
for (const pkgName of PUBLISH_ORDER) {
218218
if (!bumpedNames.has(pkgName)) continue;
219219

220-
const pkgDir = await findPackageDir(input.worktreePath, pkgName);
221-
if (!pkgDir) {
222-
skipped.push({ package: pkgName, reason: "package.json not found" });
223-
continue;
224-
}
225-
226220
if (input.plan) {
221+
// In plan mode, skip actual directory lookup — it's a dry-run.
227222
console.log(
228-
`[publish] would run: npm publish --access public (cwd: ${pkgDir})`,
223+
"[publish] would run: npm publish --access public (cwd: packages/...)",
229224
);
230225
published.push(pkgName);
231226
continue;
232227
}
233228

229+
const pkgDir = await findPackageDir(input.worktreePath, pkgName);
230+
if (!pkgDir) {
231+
skipped.push({ package: pkgName, reason: "package.json not found" });
232+
continue;
233+
}
234+
234235
try {
235236
await execa("npm", ["publish", "--access", "public"], { cwd: pkgDir });
236237
published.push(pkgName);
@@ -242,7 +243,7 @@ const publishFn = defineFunction({
242243
}
243244
}
244245

245-
if (skipped.length > 0) {
246+
if (!input.plan && skipped.length > 0) {
246247
const details = skipped
247248
.map((s) => `${s.package}: ${s.reason}`)
248249
.join("; ");

0 commit comments

Comments
 (0)