github

package
v0.0.0-...-b60e317 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 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) 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) 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) EnsureBranchExists

func (g *Github) EnsureBranchExists(repository, branchName, fallbackBranch string) error

EnsureBranchExists checks if a branch exists in the repository and creates one from fallback branch if not.

func (*Github) ExistsRef

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

func (*Github) ForkRepository

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

Fork repository in our organization

func (*Github) ForkRepositoryFromOrg

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

Fork repository from another organization to our org

func (*Github) ForkRepositoryToOrg

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

For repozitory from our organization to another org

func (*Github) ForkRepositoryWithOrgs

func (g *Github) ForkRepositoryWithOrgs(sourceOrgName, sourceName, targetOrgName, 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) GetCheckRunStatus

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

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

func (*Github) GetCheckRunText

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

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

func (*Github) GetFile

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

func (*Github) GetFileWithOrg

func (g *Github) GetFileWithOrg(org, 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)

func (*Github) UpdateGithubOrg

func (g *Github) UpdateGithubOrg(githubOrg string)

func (*Github) UpdatePullRequestBranch

func (g *Github) UpdatePullRequestBranch(repository string, prNumber int) error

UpdatePullRequestBranch updates the PR branch with the latest changes from the base branch. This is useful when the PR branch is out of date and GitHub returns 409 on merge.

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