github

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package github provides GitHub API client operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMergeMethod added in v0.4.0

func GetMergeMethod(squash bool) string

GetMergeMethod returns the appropriate merge method string based on squash flag. Returns "squash" if squash is true, otherwise "merge".

Types

type Client

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

Client represents a GitHub API client wrapper.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new GitHub client.

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(
	head, base, title, body string,
	assignees, reviewers, labels []string,
) (*github.PullRequest, error)

CreatePullRequest creates a new pull request with assignees, reviewers, and labels.

func (*Client) DeleteBranch

func (c *Client) DeleteBranch(branch string) error

DeleteBranch deletes a branch from the remote repository.

func (*Client) GetPullRequestByBranch

func (c *Client) GetPullRequestByBranch(head, base string) (*github.PullRequest, error)

GetPullRequestByBranch fetches an existing pull request by head and base branches.

func (*Client) GetPullRequestsByHead

func (c *Client) GetPullRequestsByHead(head string) ([]*github.PullRequest, error)

GetPullRequestsByHead returns all open pull requests for the given head branch.

func (*Client) ListLabels

func (c *Client) ListLabels() ([]*Label, error)

ListLabels returns all labels for the repository.

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(prNumber int, mergeMethod string) error

MergePullRequest merges a pull request using the specified merge method. mergeMethod can be "merge", "squash", or "rebase".

func (*Client) SetLogger

func (c *Client) SetLogger(logger *bullets.Logger)

SetLogger sets the logger for the GitHub client.

func (*Client) SetRepositoryFromURL

func (c *Client) SetRepositoryFromURL(url string) error

SetRepositoryFromURL sets the repository from a git remote URL.

func (*Client) WaitForWorkflows

func (c *Client) WaitForWorkflows(timeout time.Duration) (string, error)

WaitForWorkflows waits for all workflow runs to complete for the pull request.

type Label

type Label struct {
	Name string
}

Label represents a GitHub label.

Jump to

Keyboard shortcuts

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