fix: handle direct upload Pages projects

This commit is contained in:
yoma committed 2026-07-14 20:40:24 +08:00
1 parent 0b1ab0d7df
commit a1ce678a11
4 files changed
+30 -17

No files matched your search

+19 -11
View File
@@ -150,18 +150,26 @@ const triggerPayload = (workerTag, repoConnectionUuid, buildTokenUuid) => ({
const configurePagesWatchPaths = async () => {
if (!pagesProjectName) return;
await request("PATCH", `/accounts/${accountId}/pages/projects/${encodeURIComponent(pagesProjectName)}`, {
source: {
config: {
// `*` spans nested directories in Cloudflare Pages. Root lockfiles and
// package metadata are shared build inputs, so they intentionally trigger
// both projects when changed.
path_includes: ["apps/site/*", "bun.lock", "package.json"],
path_excludes: [],
try {
await request("PATCH", `/accounts/${accountId}/pages/projects/${encodeURIComponent(pagesProjectName)}`, {
source: {
config: {
// `*` spans nested directories in Cloudflare Pages. Root lockfiles and
// package metadata are shared build inputs, so they intentionally trigger
// both projects when changed.
path_includes: ["apps/site/*", "bun.lock", "package.json"],
path_excludes: [],
},
},
},
});
console.log(`[ok] configured Pages watch paths for ${pagesProjectName}`);
});
console.log(`[ok] configured Pages watch paths for ${pagesProjectName}`);
} catch (error) {
if (error instanceof Error && error.message.includes("Direct Uploads project")) {
console.log(`[skip] ${pagesProjectName} is a Direct Upload Pages project; its deploy workflow already controls path filtering.`);
return;
}
throw error;
}
};
const setup = async () => {