github

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePRNumber

func ParsePRNumber(s string) (int, error)

ParsePRNumber parses a PR number from a string.

func ParsePatchLines

func ParsePatchLines(patch string) map[int]int

Types

type Client

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

func NewClient

func NewClient(token string) *Client

func (*Client) PostReview

func (c *Client) PostReview(ctx context.Context, owner, repo string, prNumber int, comments []ReviewComment, commitSHA string) error

PostReview posts all findings as a single PR review. Comments on lines within the diff are posted inline; comments on changed files but outside diff hunks become file-level comments; findings on unchanged files are listed in the review body.

func (*Client) PostSummaryComment

func (c *Client) PostSummaryComment(ctx context.Context, owner, repo string, prNumber int, body string) error

PostSummaryComment posts a regular comment (not a review) on a PR.

type PRMetadata

type PRMetadata struct {
	Owner     string
	Repo      string
	Number    int
	CommitSHA string
}

PRMetadata holds the information needed to post review comments on a PR.

func LoadPRMetadataFromEnv

func LoadPRMetadataFromEnv() (*PRMetadata, error)

LoadPRMetadataFromEnv extracts PR metadata from GitHub Actions environment variables.

func LoadPRMetadataFromFlags

func LoadPRMetadataFromFlags(owner, repo string, prNumber int, commitSHA string) *PRMetadata

LoadPRMetadataFromFlags allows manual override via CLI flags (for testing/local use).

type ReviewComment

type ReviewComment struct {
	Path string `json:"path"`
	Line int    `json:"line"`
	Body string `json:"body"`
}

ReviewComment is a local DTO for a future GitHub API integration. V1 intentionally does not call GitHub directly.

func BuildReviewComments

func BuildReviewComments(reports []models.Report) []ReviewComment

Jump to

Keyboard shortcuts

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