Answer stability round 1: 0 🔴, 3 🟡 (0 misread); the description test refuses an empty one and needs a sentence start, the PATCH body is a tested pure function, the trial-stack block moves to Quick start
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
// Publishes the Docker Hub repository overview from dockerhub-overview.md.tmpl, rendering
|
||||
// `{{VERSION}}` to the release being published, and the short description.
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
@@ -10,6 +7,10 @@ const VERSION = /^\d+\.\d+\.\d+$/;
|
||||
|
||||
export const DESCRIPTION = "A self-hostable foundation for server-rendered web applications";
|
||||
|
||||
export function hubPatch(overview: string): { description: string; full_description: string } {
|
||||
return { description: DESCRIPTION, full_description: overview };
|
||||
}
|
||||
|
||||
export function renderOverview(source: string, version: string): string {
|
||||
return source.replaceAll("{{VERSION}}", version);
|
||||
}
|
||||
@@ -83,7 +84,7 @@ async function main(): Promise<number> {
|
||||
if (!jwt) return fail("Docker Hub login returned no token");
|
||||
|
||||
const res = await post(`${HUB}/repositories/${repo}/`, {
|
||||
body: JSON.stringify({ description: DESCRIPTION, full_description: body }),
|
||||
body: JSON.stringify(hubPatch(body)),
|
||||
headers: { authorization: `Bearer ${jwt}`, "content-type": "application/json" },
|
||||
method: "PATCH",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user