Github enhancement

This commit is contained in:
Stijnus
2025-01-28 13:21:24 +01:00
parent 387516b7fd
commit f32016c91d
4 changed files with 136 additions and 42 deletions

View File

@@ -434,7 +434,13 @@ export class WorkbenchStore {
return syncedFiles;
}
async pushToGitHub(repoName: string, commitMessage?: string, githubUsername?: string, ghToken?: string) {
async pushToGitHub(
repoName: string,
commitMessage?: string,
githubUsername?: string,
ghToken?: string,
isPrivate: boolean = false,
) {
try {
// Use cookies if username and token are not provided
const githubToken = ghToken || Cookies.get('githubToken');
@@ -458,7 +464,7 @@ export class WorkbenchStore {
// Repository doesn't exist, so create a new one
const { data: newRepo } = await octokit.repos.createForAuthenticatedUser({
name: repoName,
private: false,
private: isPrivate,
auto_init: true,
});
repo = newRepo;