Created
July 15, 2023 07:30
-
-
Save maskaravivek/287ae42a41f91b7284dfbf21bcf65516 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function pushChangesToGithub( | |
| githubAccessToken, | |
| commitTitle, | |
| githubRepoFullName, | |
| githubRepoBranchName | |
| ) { | |
| try { | |
| const articleFiles = [ | |
| { | |
| path: "/my-new-website/index.html", | |
| content: "Hello World!", | |
| encoding: "utf-8", | |
| }, | |
| { | |
| path: "/my-new-website/images/logo.png", | |
| content: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ", | |
| encoding: "base64", | |
| }, | |
| ]; | |
| await createGithubCommit( | |
| githubAccessToken, | |
| githubRepoFullName, | |
| githubRepoBranchName, | |
| commitTitle, | |
| articleFiles | |
| ); | |
| } catch (err) { | |
| console.error(err); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment