Scope the sidecar trailer by package so a mixed branch cannot lose it
CI / full-gate (push) Successful in 2m50s
CI / full-gate (push) Successful in 2m50s
This commit is contained in:
@@ -28,8 +28,8 @@ test("the quick start's sidecars are pinned to the same versions this repo runs"
|
||||
const pins = (source: string) =>
|
||||
new Map([...source.matchAll(/image: ([^:\s]+):(v?\d\S*)/g)].map((m) => [m[1] ?? "", m[2] ?? ""]));
|
||||
const ours = new Map([
|
||||
...pins(readFileSync("compose.yml", "utf8")),
|
||||
...pins(readFileSync("compose.override.yml", "utf8")),
|
||||
...pins(readFileSync("compose.yml", "utf8")), // production wins: the template is the prod quick start
|
||||
]);
|
||||
const published = pins(template());
|
||||
assert.ok(published.size > 0, "the template should pin sidecars");
|
||||
|
||||
@@ -60,7 +60,13 @@ async function main(): Promise<number> {
|
||||
if (!VERSION.test(version)) return fail(`version must be X.Y.Z, got ${JSON.stringify(version)}`);
|
||||
|
||||
const templatePath = join(import.meta.dirname, "dockerhub-overview.md.tmpl");
|
||||
const body = renderOverview(readFileSync(templatePath, "utf8"), version);
|
||||
let template = "";
|
||||
try {
|
||||
template = readFileSync(templatePath, "utf8");
|
||||
} catch (err) {
|
||||
return fail(`${templatePath}: ${err instanceof Error ? err.message : String(err)}`);
|
||||
}
|
||||
const body = renderOverview(template, version);
|
||||
const leftover = leftoverPlaceholders(body);
|
||||
if (leftover.length > 0) return fail(`${templatePath} has unrendered placeholders: ${leftover.join(", ")}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user