github

package
v0.3.0-20260807201250-... Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMergeChecker

func NewMergeChecker(params Params) mergechecker.MergeChecker

NewMergeChecker creates a new GitHub MergeChecker.

Types

type PRInfo

type PRInfo struct {
	// Number is the pull request number.
	Number int
	// Mergeable is the mergeability state of the PR.
	Mergeable PRMergeableState
	// BaseRefName is the base branch the PR targets.
	BaseRefName string
	// HeadRefName is the head branch of the PR.
	HeadRefName string
	// HeadRefOid is the current head commit SHA of the PR.
	HeadRefOid string
	// State is the current state of the PR (OPEN, CLOSED, MERGED).
	State PRState
}

PRInfo holds the relevant pull request information fetched from GitHub.

type PRMergeableState

type PRMergeableState string

PRMergeableState represents the mergeability state of a pull request.

const (
	// PRMergeableStateMergeable indicates the PR can be merged cleanly.
	PRMergeableStateMergeable PRMergeableState = "MERGEABLE"
	// PRMergeableStateConflicting indicates the PR has merge conflicts.
	PRMergeableStateConflicting PRMergeableState = "CONFLICTING"
	// PRMergeableStateUnknown indicates GitHub hasn't computed mergeability yet.
	// GitHub computes mergeability asynchronously after pushes. The GraphQL API
	// returns UNKNOWN when the computation hasn't finished, even though the API
	// call itself is synchronous. Callers should retry after a short delay.
	PRMergeableStateUnknown PRMergeableState = "UNKNOWN"
)

type PRState

type PRState string

PRState represents the state of a pull request.

const (
	// PRStateOpen indicates the PR is open.
	PRStateOpen PRState = "OPEN"
	// PRStateClosed indicates the PR is closed.
	PRStateClosed PRState = "CLOSED"
	// PRStateMerged indicates the PR has been merged.
	PRStateMerged PRState = "MERGED"
)

type Params

type Params struct {
	// HTTPClient is a pre-configured HTTP client. The caller is responsible for
	// configuring the base URL (via BaseURLTransport) and auth (via a transport layer).
	HTTPClient *http.Client
	// Logger is the structured logger.
	Logger *zap.SugaredLogger
	// MetricsScope is the metrics scope for instrumentation.
	MetricsScope tally.Scope
}

Params holds the dependencies for the GitHub MergeChecker.

Jump to

Keyboard shortcuts

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