Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 956 Bytes

README.md

File metadata and controls

49 lines (37 loc) · 956 Bytes

@himenon/github-api-create-commit

Create a Commit to GitHub via WebAPI.

Install

yarn add @himenon/github-api-create-commit

pnpm add @himenon/github-api-create-commit

Usage

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

LICENCE

@Himenon/github-api-create-commit・MIT