github

package
v0.0.0-...-38d5e0a Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

Client implements the GitClient interface for GitHub

func (*Client) AddLabels

func (c *Client) AddLabels(labels []string) error

AddLabels adds labels to the pull request

func (*Client) ApprovePR

func (c *Client) ApprovePR(message string) error

ApprovePR creates a review approval for the PR

func (*Client) AssignReviewers

func (c *Client) AssignReviewers(reviewers []string) error

AssignReviewers assigns users as reviewers to the PR (one by one to ensure all are assigned)

func (*Client) BranchExists

func (c *Client) BranchExists(branchName string) (bool, error)

BranchExists checks if a branch exists in the repository

func (*Client) CheckPRStatus

func (c *Client) CheckPRStatus(expectedState string) error

CheckPRStatus verifies if the PR is in the expected state

func (*Client) CheckRunsStatus

func (c *Client) CheckRunsStatus() (bool, []git.CheckRun, error)

CheckRunsStatus checks if all check runs are successful with pagination

func (*Client) CheckUserPermissions

func (c *Client) CheckUserPermissions(username string, requiredPerms []string) (bool, string, error)

CheckUserPermissions validates if user has required permissions

func (*Client) CherryPickCommit

func (c *Client) CherryPickCommit(commitSHA, targetBranch string) error

CherryPickCommit cherry-picks a commit to a branch by applying only the changes from that commit

func (*Client) ClosePR

func (c *Client) ClosePR() error

ClosePR closes the pull request without merging

func (*Client) CreateBranch

func (c *Client) CreateBranch(branchName, baseBranch string) error

CreateBranch creates a new branch from the specified base branch

func (*Client) CreatePR

func (c *Client) CreatePR(title, body, head, base string) (*git.PullRequest, error)

CreatePR creates a new pull request

func (*Client) DismissApprove

func (c *Client) DismissApprove(message string) error

DismissApprove dismisses the token user's approval review

func (*Client) FindIssue

func (c *Client) FindIssue(opts git.IssueSearchOptions) (*git.Issue, error)

FindIssue locates an issue using search options

func (*Client) GetAvailableMergeMethods

func (c *Client) GetAvailableMergeMethods() ([]string, error)

GetAvailableMergeMethods retrieves the available merge methods for the pull request

func (*Client) GetComments

func (c *Client) GetComments() ([]git.Comment, error)

GetComments retrieves all comments from the pull request with pagination

func (*Client) GetCommits

func (c *Client) GetCommits() ([]git.Commit, error)

GetCommits retrieves commits from a pull request

func (*Client) GetIssue

func (c *Client) GetIssue(issueNumber int) (*git.Issue, error)

GetIssue retrieves an issue by number

func (*Client) GetLGTMVotes

func (c *Client) GetLGTMVotes(comments []git.Comment, requiredPerms []string, debugMode bool, ignoreUserRemove ...string) (int, map[string]string, error)

GetLGTMVotes retrieves and validates LGTM votes using provided or fetched comments

func (*Client) GetLabels

func (c *Client) GetLabels() ([]string, error)

GetLabels retrieves current labels of the pull request

func (*Client) GetPR

func (c *Client) GetPR() (*git.PullRequest, error)

GetPR retrieves the pull request information

func (*Client) GetRequestedReviewers

func (c *Client) GetRequestedReviewers() ([]string, error)

GetRequestedReviewers retrieves current requested reviewers for the PR

func (*Client) GetReviews

func (c *Client) GetReviews() ([]git.Review, error)

GetReviews retrieves all reviews from the pull request with pagination

func (*Client) GetUserPermission

func (c *Client) GetUserPermission(username string) (string, error)

GetUserPermission gets the user's permission level for the repository

func (*Client) GetWorkflowRunIDsFromCheckSuite

func (c *Client) GetWorkflowRunIDsFromCheckSuite(checkSuiteID int64) ([]int64, error)

GetWorkflowRunIDsFromCheckSuite retrieves workflow run IDs from a check suite Returns a slice of workflow run IDs associated with the check suite

func (*Client) MergePR

func (c *Client) MergePR(method string) error

MergePR merges the pull request with the specified method

func (*Client) PostComment

func (c *Client) PostComment(message string) error

PostComment posts a comment to the pull request

func (*Client) RebasePR

func (c *Client) RebasePR() error

RebasePR updates the PR branch with the base branch

func (*Client) RemoveLabels

func (c *Client) RemoveLabels(labels []string) error

RemoveLabels removes labels from the pull request

func (*Client) RemoveReviewers

func (c *Client) RemoveReviewers(reviewers []string) error

RemoveReviewers removes users from PR reviewers

func (*Client) RerunWorkflowRunFailedJobs

func (c *Client) RerunWorkflowRunFailedJobs(runID int64) error

RerunWorkflowRunFailedJobs reruns failed jobs in a workflow run

func (*Client) TriggerWorkflowDispatch

func (c *Client) TriggerWorkflowDispatch(workflowFile, ref string, inputs map[string]interface{}) error

TriggerWorkflowDispatch triggers a workflow via workflow_dispatch event

func (*Client) UpdateIssueBody

func (c *Client) UpdateIssueBody(issueNumber int, body string) error

UpdateIssueBody updates an issue body/description

func (*Client) UpdatePRBody

func (c *Client) UpdatePRBody(body string) error

UpdatePRBody updates the pull request body/description

type Factory

type Factory struct{}

Factory implements ClientFactory for GitHub

func (*Factory) CreateClient

func (f *Factory) CreateClient(logger *logrus.Logger, config *git.Config) (git.GitClient, error)

CreateClient creates a new GitHub client

Jump to

Keyboard shortcuts

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