Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maskaravivek/287ae42a41f91b7284dfbf21bcf65516 to your computer and use it in GitHub Desktop.
Save maskaravivek/287ae42a41f91b7284dfbf21bcf65516 to your computer and use it in GitHub Desktop.
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