Create a Commit to GitHub via WebAPI.
yarn add @himenon/github-api-create-commit
pnpm add @himenon/github-api-create-commit
import * as GitHubApiCreateCommit from "@himenon/github-api-create-commit";
const github = GitHubApiCreateCommit.create({
owner: "Himenon",
repo: "github-api-create-commit",
accessToken: "",
});
await github.createGitCommit({
baseBranchName: "master",
headBranchName: "develop",
commitMessage: "feat: add markdown file",
files: [
{
path: "hello-world.md",
content: "# Hello world",
},
],
});
Shell scripts with the same meaning
git checkout -b develop origin/master
echo "# Hello world" > hello-world.md
git add hello-world.md
git commit -m "feat: add markdown file"
git push develop