GitHub workflows (#428)

Fixes #348 
Fixes #274 
Fixes #149 

- Connect to existing repos
- Push to other branches on GitHub besides main
- Allows force push (with confirmation) dialog

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
This commit is contained in:
Will Chen
2025-06-17 16:59:26 -07:00
committed by GitHub
parent 9694e4a2e8
commit bd809a010d
24 changed files with 2686 additions and 237 deletions

View File

@@ -554,6 +554,36 @@ export class IpcClient {
// --- End GitHub Device Flow ---
// --- GitHub Repo Management ---
public async listGithubRepos(): Promise<
{ name: string; full_name: string; private: boolean }[]
> {
return this.ipcRenderer.invoke("github:list-repos");
}
public async getGithubRepoBranches(
owner: string,
repo: string,
): Promise<{ name: string; commit: { sha: string } }[]> {
return this.ipcRenderer.invoke("github:get-repo-branches", {
owner,
repo,
});
}
public async connectToExistingGithubRepo(
owner: string,
repo: string,
branch: string,
appId: number,
): Promise<void> {
await this.ipcRenderer.invoke("github:connect-existing-repo", {
owner,
repo,
branch,
appId,
});
}
public async checkGithubRepoAvailable(
org: string,
repo: string,
@@ -568,25 +598,25 @@ export class IpcClient {
org: string,
repo: string,
appId: number,
branch?: string,
): Promise<void> {
await this.ipcRenderer.invoke("github:create-repo", {
org,
repo,
appId,
branch,
});
}
// Sync (push) local repo to GitHub
public async syncGithubRepo(
appId: number,
force?: boolean,
): Promise<{ success: boolean; error?: string }> {
try {
const result = await this.ipcRenderer.invoke("github:push", { appId });
return result as { success: boolean; error?: string };
} catch (error) {
showError(error);
throw error;
}
return this.ipcRenderer.invoke("github:push", {
appId,
force,
});
}
public async disconnectGithubRepo(appId: number): Promise<void> {