github

package
v0.0.0-...-60324e7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package github provides GitHub API client functionality for goreviewer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvToken

func GetEnvToken() string

GetEnvToken returns the GitHub token from environment.

func GetPRFromEnv

func GetPRFromEnv() (owner, repo string, prNumber int, err error)

GetPRFromEnv returns PR details from environment variables.

Types

type Client

type Client struct {
	Token          string
	IncludePrev    bool
	IncludeHuman   bool
	IncludeChecks  bool
	IncludeLabels  bool
	IncludeDesc    bool
	IncludeCommits bool
	// contains filtered or unexported fields
}

Client wraps GitHub API client and configuration.

func NewClient

func NewClient() *Client

NewClient creates a new GitHub client with default settings.

func (*Client) AddLabel

func (c *Client) AddLabel(ctx context.Context, label string) error

AddLabel adds a label to the PR.

func (*Client) FetchContext

func (c *Client) FetchContext(ctx context.Context) (Context, error)

FetchContext fetches GitHub context for a PR.

func (*Client) PostReview

func (c *Client) PostReview(ctx context.Context, body string) error

PostReview posts a new review comment to the PR.

func (*Client) RemoveLabel

func (c *Client) RemoveLabel(ctx context.Context, label string) error

RemoveLabel removes a label from the PR.

func (*Client) ReplyToReviewComment

func (c *Client) ReplyToReviewComment(ctx context.Context, commentID int64, body string) error

ReplyToReviewComment replies to a specific review comment.

func (*Client) SetPR

func (c *Client) SetPR(owner, repo string, prNumber int)

SetPR sets the PR owner, repo, and number for context fetching.

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken sets the GitHub token for authentication.

type Context

type Context struct {
	CheckRuns      string
	Labels         string
	PRDescription  string
	Commits        string
	PreviousReview string
	HumanComments  string
}

Context holds GitHub PR context information.

Jump to

Keyboard shortcuts

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