web designer: guard ignores uploaded media assets (app/public/media)

This commit is contained in:
Carlos Arias 2026-07-24 00:20:52 +00:00
parent 50f6db55d8
commit 364fd1b425

View file

@ -493,8 +493,15 @@ async function runDesignTask(task) {
// Pre-flight: the auto-publish commit is scoped to GIT_SCOPE, so a dirty tree
// would get swept into this task's commit. Refuse rather than clobber WIP.
// Uploaded assets under app/public/media/ are expected (they're this task's
// images) and get committed with it, so they don't count as "dirty".
const pre = await git(["status", "--porcelain", "--", ...GIT_SCOPE]);
if (pre.tail.trim() !== "") {
const dirty = pre.tail
.split("\n")
.map((l) => l.slice(3).trim()) // strip the "XY " status prefix
.filter(Boolean)
.filter((p) => !p.startsWith("app/public/media/"));
if (dirty.length) {
return { ok: false, error: "Working tree wasn't clean — commit or discard pending changes before running the queue." };
}