githubapi

package
v0.0.0-...-7ebfa8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePR

func CreatePR(ctx context.Context, client *github.Client, prRepoOwner string, prRepo string, sourceOwner string,
	commitBranch string, sourceRepo string, prSubject string, prBranch string, prDescription string) (err error)

createPR creates a pull request. Based on: https://godoc.org/github.com/google/go-github/github#example-PullRequestsService-Create

func GetRef

func GetRef(ctx context.Context, client *github.Client, sourceOwner string, sourceRepo string, timeStamp string, commitBranch string, baseBranch string) (ref *github.Reference, err error)

GetRef returns the commit branch reference object if it exists or creates it from the base branch before returning it.

func GetTree

func GetTree(ctx context.Context, client *github.Client, ref *github.Reference, sourceFiles string, sourceOwner string,
	sourceRepo string) (tree *github.Tree, err error)

GetTree generates the tree to commit based on the given files and the commit of the ref you got in getRef.

func PushCommit

func PushCommit(ctx context.Context, client *github.Client, ref *github.Reference, tree *github.Tree,
	sourceOwner string, sourceRepo string, authorName string, authorEmail string, commitMessage string) (err error)

pushCommit creates the commit in the given reference using the given tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL