Skip to content

Commit

Deploying: a Plan that cannot read migrations says why

It named the units and nothing else, so a CI failure (a token, a blocked domain) could not be told apart from the log. It now adds the first unit's error; one cause is usually all of them.

syntaqxcommitted Parentd7b336dBrowse files
1 file+5−10/1 viewed
+5−1
124124 const include = jobs.length ? jobs : [{ group: "none", units: "" }];
125125 lines.push(`has_${stage}=${jobs.length > 0}`, `${stage}=${JSON.stringify({ include })}`);
126126 }
127− if (data.migration_errors.length) throw new Error(`Could not read pending migrations: ${data.migration_errors.map((e) => e.unit).join(", ")}`);
127+ if (data.migration_errors.length) {
128+ // The units, then why for the first: one cause (a token, say) is usually all of them.
129+ throw new Error(`Could not read pending migrations: ${data.migration_errors.map((e) => e.unit).join(", ")}
130+${data.migration_errors[0].error}`);
131+ }
128132 if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, `${lines.join("\n")}\n`);
129133 else console.log(lines.join("\n"));
130134 if (process.env.GITHUB_STEP_SUMMARY) {