go-github: github.com/google/go-github/example/commitpr Files

Command commitpr

The commitpr command utilizes go-github as a CLI tool for pushing files to a branch and creating a pull request from it. It takes an auth token as an environment variable and creates the commit and the PR under the account affiliated with that token.

The purpose of this example is to show how to use refs, trees and commits to create commits and pull requests.

Note, if you want to push a single file, you probably prefer to use the content API. An example is available here: https://godoc.org/github.com/google/go-github/github#example-RepositoriesService-CreateFile

Note, for this to work at least 1 commit is needed, so you if you use this after creating a repository you might want to make sure you set `AutoInit` to `true`.

Package Files

main.go

Package main imports 11 packages (graph). Updated 2019-09-01. Refresh now. Tools for package owners.