github

package
v0.0.0-...-073f691 Latest Latest
Warning

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

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

Documentation

Overview

Package github provides optional V1 GitHub metadata enrichment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvTokenAvailable

func EnvTokenAvailable() bool

EnvTokenAvailable reports whether a GitHub token is present in common environment variables.

func GHTokenAvailable

func GHTokenAvailable() bool

GHTokenAvailable reports whether the GitHub CLI can provide a token.

func ResolveToken

func ResolveToken(flagValue string) (string, bool)

ResolveToken treats the explicit flag value as either a literal token or env var name.

Types

type Metadata

type Metadata struct {
	Available   bool
	Reason      string
	Limitations []string
	PRs         []PullRequest
}

Metadata contains optional GitHub PR enrichment.

func FetchMergedPRs

func FetchMergedPRs(ctx context.Context, owner, repo, token string, maxPRs int) (Metadata, error)

FetchMergedPRs fetches recent merged pull requests. It is enrichment only.

type PullRequest

type PullRequest struct {
	Number           int
	Title            string
	URL              string
	MergedAt         time.Time
	ChangedFiles     int
	Additions        int
	Deletions        int
	Commits          int
	ReviewComments   int
	IssueComments    int
	Files            []string
	ReviewCount      int
	RequestedChanges int
	Approvals        int
	CheckRuns        int
	FailedChecks     int
	SuccessfulChecks int
	MergeCommitSHA   string
}

PullRequest is the subset of GitHub PR metadata V1 uses.

Jump to

Keyboard shortcuts

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