githubapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 14 Imported by: 0 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

View Source
var Commands = func() []CommandDef {
	defs := make([]CommandDef, len(dispatchTable))
	for i, ch := range dispatchTable {
		defs[i] = ch.def
	}
	return defs
}()

Commands exposes the command definitions for doc generation.

View Source
var EventPluginLabels = []LabelDef{
	{Name: "lgtm", Meaning: "PR has been approved."},
	{Name: "do-not-merge", Meaning: "PR is not ready to merge."},
}

EventPluginLabels documents the labels used by the event plugin.

View Source
var PREvents = []PREventDef{
	{
		Action:   "opened",
		Behavior: "Adds `do-not-merge` label; creates LGTM check run with `neutral` conclusion.",
	},
	{
		Action:   "reopened",
		Behavior: "Adds `do-not-merge`, removes `lgtm`, posts an approval-reset comment, and creates an LGTM check run with `neutral` conclusion.",
	},
}

PREvents documents the pull_request webhook actions handled by the event plugin.

Functions

func ProcessComment

func ProcessComment(event *github.IssueCommentEvent, client *github.Client, logger *slog.Logger)

func RegisterEventHandlers

func RegisterEventHandlers(r *gin.Engine, client *github.Client, logger *slog.Logger, processComment func(*github.IssueCommentEvent, *github.Client, *slog.Logger)) func(string, []byte)

Types

type CommandDef added in v0.3.0

type CommandDef struct {
	// Triggers are the slash-command prefixes that activate this command.
	Triggers    []string
	Description string
	// Usage shows the full invocation syntax.
	Usage string
}

CommandDef describes a slash command handled by the event plugin.

type LabelDef added in v0.3.0

type LabelDef struct {
	Name    string
	Meaning string
}

LabelDef documents a GitHub label used by the event plugin.

type PREventDef added in v0.3.0

type PREventDef struct {
	Action   string
	Behavior string
}

PREventDef documents a pull_request webhook action handled by the event plugin.

type ProwGitHubClient

type ProwGitHubClient interface {
	GetClient() *github.Client
	CreateCheckRun(ctx context.Context, owner, repo string, opt github.CreateCheckRunOptions) (*github.CheckRun, *github.Response, error)
}

ProwGitHubClient is the interface consumed by callers that need a GitHub client.

type ProwLiteGitHubClient

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

ProwLiteGitHubClient wraps a GitHub client authenticated as a GitHub App installation.

func NewGithubClient

func NewGithubClient(logger *slog.Logger) (*ProwLiteGitHubClient, error)

func (*ProwLiteGitHubClient) CreateCheckRun

func (*ProwLiteGitHubClient) GetClient

func (g *ProwLiteGitHubClient) GetClient() *github.Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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