fix: improve push to github option (#1111)

* feat: better push to githubbutton

* added url update on push to github
This commit is contained in:
Anirban Kar
2025-01-27 17:58:25 +05:30
committed by GitHub
parent df766c98d4
commit 6d4196a2b4
7 changed files with 95 additions and 19 deletions

View File

@@ -434,7 +434,7 @@ export class WorkbenchStore {
return syncedFiles;
}
async pushToGitHub(repoName: string, githubUsername?: string, ghToken?: string) {
async pushToGitHub(repoName: string, commitMessage?: string, githubUsername?: string, ghToken?: string) {
try {
// Use cookies if username and token are not provided
const githubToken = ghToken || Cookies.get('githubToken');
@@ -523,7 +523,7 @@ export class WorkbenchStore {
const { data: newCommit } = await octokit.git.createCommit({
owner: repo.owner.login,
repo: repo.name,
message: 'Initial commit from your app',
message: commitMessage || 'Initial commit from your app',
tree: newTree.sha,
parents: [latestCommitSha],
});