github

package
v0.0.0-...-d01df85 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADS = "heads/%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Github

type Github struct {
	// contains filtered or unexported fields
}

func NewGithubClient

func NewGithubClient(token, organization string) (*Github, error)

func (*Github) CheckIfReleaseExist

func (g *Github) CheckIfReleaseExist(owner, repositoryName, releaseURL string) bool

func (*Github) CheckIfRepositoryExist

func (g *Github) CheckIfRepositoryExist(repository string) bool

func (*Github) CreateFile

func (g *Github) CreateFile(repository, pathToFile, fileContent, branchName string) (*github.RepositoryContentResponse, error)

func (*Github) CreatePullRequest

func (g *Github) CreatePullRequest(repository, title, body, head, base string) (*github.PullRequest, error)

func (*Github) CreateRef

func (g *Github) CreateRef(repository, baseBranchName, sha, newBranchName string) error

CreateRef creates a new ref (GitHub branch) in a specified GitHub repository, that will be based on the commit specified with sha. If sha is not specified the latest commit from base branch will be used.

func (*Github) CreateRefInOrg

func (g *Github) CreateRefInOrg(githubOrg, repository, baseBranchName, sha, newBranchName string) error

func (*Github) CreateWebhook

func (g *Github) CreateWebhook(repository, url string) (int64, error)

func (*Github) DeleteFile

func (g *Github) DeleteFile(repository, pathToFile, branchName string) error

func (*Github) DeleteRef

func (g *Github) DeleteRef(repository, branchName string) error

func (*Github) DeleteRefFromOrg

func (g *Github) DeleteRefFromOrg(githubOrg, repository, branchName string) error

func (*Github) DeleteRelease

func (g *Github) DeleteRelease(owner, repositoryName, releaseURL string) bool

func (*Github) DeleteRepository

func (g *Github) DeleteRepository(repository *github.Repository) error

func (*Github) DeleteRepositoryIfExists

func (g *Github) DeleteRepositoryIfExists(name string) error

func (*Github) DeleteWebhook

func (g *Github) DeleteWebhook(repository string, ID int64) error

func (*Github) ExistsRef

func (g *Github) ExistsRef(repository, branchName string) (bool, error)

func (*Github) ExistsRefInOrg

func (g *Github) ExistsRefInOrg(githubOrg, repository, branchName string) (bool, error)

func (*Github) ForkRepository

func (g *Github) ForkRepository(sourceName, targetName string) (*github.Repository, error)

func (*Github) GetAllRepositories

func (g *Github) GetAllRepositories() ([]*github.Repository, error)

func (*Github) GetCheckRun

func (g *Github) GetCheckRun(repository string, id int64) (*github.CheckRun, error)

func (*Github) GetCheckRunConclusion

func (g *Github) GetCheckRunConclusion(checkRunName, repoName, prHeadSha string, prNumber int) (string, error)

GetCheckRunConclusion fetches a specific CheckRun within a given repo by matching the CheckRun's name with the given checkRunName, and then returns the CheckRun conclusion

func (*Github) GetFile

func (g *Github) GetFile(repository, pathToFile, branchName string) (*github.RepositoryContent, error)

func (*Github) GetPRDetails

func (g *Github) GetPRDetails(ghRepo string, prID int) (string, string, error)

func (*Github) GetPullRequest

func (g *Github) GetPullRequest(repository string, id int) (*github.PullRequest, error)

func (*Github) ListCheckRuns

func (g *Github) ListCheckRuns(repository string, ref string) ([]*github.CheckRun, error)

func (*Github) ListPullRequestCommentsSince

func (g *Github) ListPullRequestCommentsSince(repository string, prNumber int, since time.Time) ([]*github.IssueComment, error)

func (*Github) ListPullRequests

func (g *Github) ListPullRequests(repository string) ([]*github.PullRequest, error)

func (*Github) ListRepoWebhooks

func (g *Github) ListRepoWebhooks(repository string) ([]*github.Hook, error)

func (*Github) MergePullRequest

func (g *Github) MergePullRequest(repository string, prNumber int) (*github.PullRequestMergeResult, error)

func (*Github) UpdateFile

func (g *Github) UpdateFile(repository, pathToFile, newContent, branchName, fileSHA string) (*github.RepositoryContentResponse, error)

type Webhook

type Webhook struct {
	github.Hook
}

Jump to

Keyboard shortcuts

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