feat: turborepo monorepo scaffold and provisioning

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-21 16:44:30 -08:00
parent e22f5e379f
commit 8587644a62
35 changed files with 841 additions and 5 deletions

View File

@@ -163,4 +163,33 @@ export async function verifyWebhookSignature(
return expected === signature;
}
/**
* Push a single file to a repo via the Gitea contents API.
* Creates the file if it doesn't exist; updates it if it does.
*/
export async function giteaPushFile(
owner: string,
repo: string,
path: string,
content: string,
message: string,
branch = 'main',
): Promise<void> {
const encoded = Buffer.from(content).toString('base64');
// Check if file already exists to get its SHA (required for updates)
let sha: string | undefined;
try {
const existing = await giteaFetch(`/repos/${owner}/${repo}/contents/${path}?ref=${branch}`);
sha = (existing as any)?.sha;
} catch {
// File doesn't exist — create it
}
await giteaFetch(`/repos/${owner}/${repo}/contents/${path}`, {
method: sha ? 'PUT' : 'POST',
body: JSON.stringify({ message, content: encoded, branch, ...(sha ? { sha } : {}) }),
});
}
export const GITEA_ADMIN_USER_EXPORT = GITEA_ADMIN_USER;