pr

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pr provides GitHub pull request operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPRReviewers

func AddPRReviewers(ctx context.Context, gh *github.Client, owner, repo string, number int, reviewers, teamReviewers []string) (*github.PullRequest, error)

AddPRReviewers adds reviewers to a pull request.

func ApprovePR added in v0.7.0

func ApprovePR(ctx context.Context, gh *github.Client, owner, repo string, number int, body string) (*github.PullRequestReview, error)

ApprovePR adds an approval review to a pull request.

func ClosePR

func ClosePR(ctx context.Context, gh *github.Client, owner, repo string, number int) (*github.PullRequest, error)

ClosePR closes a pull request without merging.

func CommentPR added in v0.7.0

func CommentPR(ctx context.Context, gh *github.Client, owner, repo string, number int, body string) (*github.PullRequestReview, error)

CommentPR adds a comment review to a pull request.

func CreatePR

func CreatePR(ctx context.Context, gh *github.Client, upstreamOwner, upstreamRepo, forkOwner, branch, baseBranch, title, body string) (*github.PullRequest, error)

CreatePR creates a pull request.

func GetPR

func GetPR(ctx context.Context, gh *github.Client, owner, repo string, number int) (*github.PullRequest, error)

GetPR retrieves a pull request by number.

func ListPRComments

func ListPRComments(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.PullRequestComment, error)

ListPRComments lists comments on a pull request.

func ListPRFiles

func ListPRFiles(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.CommitFile, error)

ListPRFiles lists files changed in a pull request.

func ListPRReviews added in v0.7.0

func ListPRReviews(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.PullRequestReview, error)

ListPRReviews lists reviews on a pull request.

func ListPRs

func ListPRs(ctx context.Context, gh *github.Client, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, error)

ListPRs lists pull requests for a repository.

func MergePR

func MergePR(ctx context.Context, gh *github.Client, owner, repo string, number int, commitMessage string, opts *github.PullRequestOptions) (*github.PullRequestMergeResult, error)

MergePR merges a pull request.

func RequestChangesPR added in v0.7.0

func RequestChangesPR(ctx context.Context, gh *github.Client, owner, repo string, number int, body string) (*github.PullRequestReview, error)

RequestChangesPR requests changes on a pull request.

Types

type MergeableState added in v0.7.0

type MergeableState struct {
	Mergeable bool
	State     string // clean, dirty, blocked, behind, unstable, unknown
	Message   string
}

MergeableState represents the mergeable state of a PR.

func IsMergeable added in v0.7.0

func IsMergeable(ctx context.Context, gh *github.Client, owner, repo string, number int) (*MergeableState, error)

IsMergeable checks if a PR can be merged and returns detailed status.

type PRError

type PRError struct {
	Title string
	Err   error
}

PRError indicates a failure to create a pull request.

func (*PRError) Error

func (e *PRError) Error() string

func (*PRError) Unwrap

func (e *PRError) Unwrap() error

Jump to

Keyboard shortcuts

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