github

package
v0.0.0-...-96f125f Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package github fetches a PR snapshot from GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePrRef

func ParsePrRef(input string) (types.PrRef, error)

ParsePrRef accepts either a PR URL or owner/repo#N short form.

Types

type Client

type Client struct {
	REST *gh.Client
	// contains filtered or unexported fields
}

Client is a thin wrapper around go-github plus a hand-rolled GraphQL helper.

func NewClient

func NewClient(ctx context.Context) (*Client, error)

NewClient builds a GitHub client authenticated against the GITHUB_TOKEN or GH_TOKEN environment variables.

func (*Client) FetchCommitFiles

func (c *Client) FetchCommitFiles(ctx context.Context, pr types.PrRef, sha string) ([]string, error)

FetchCommitFiles returns the list of file paths a commit touches.

func (*Client) FetchFileAtRef

func (c *Client) FetchFileAtRef(ctx context.Context, pr types.PrRef, path, ref string) (*string, error)

FetchFileAtRef returns the content of a file at the given ref, or nil if it does not exist or cannot be decoded.

func (*Client) FetchPrSnapshot

func (c *Client) FetchPrSnapshot(ctx context.Context, pr types.PrRef) (*types.PrSnapshot, error)

FetchPrSnapshot retrieves all the data review-replay needs for a single PR.

func (*Client) PostInlineReply

func (c *Client) PostInlineReply(ctx context.Context, pr types.PrRef, rootCommentID int64, body string) (*PostedReply, error)

PostInlineReply posts a reply to an inline review thread whose root comment is rootCommentID. Returns the new comment's id + html_url on success.

type PostedReply

type PostedReply struct {
	ID      int64
	HTMLURL string
}

PostedReply describes a successfully posted reply.

Jump to

Keyboard shortcuts

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