github

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package github implements a client SDK for the Github API.

Index

Constants

View Source
const (
	// ErrNotFound indicates the resource does not exists.
	ErrNotFound errors.Kind = "resource not found (HTTP Status: 404)"
	// ErrUnprocessableEntity indicates the entity cannot be processed for any reason.
	ErrUnprocessableEntity errors.Kind = "entity cannot be processed (HTTP Status: 422)"
)
View Source
const (
	// Domain is the default GitHub domain.
	Domain = "github.com"
	// APIDomain is the default GitHub API domain.
	APIDomain = "api." + Domain
	// APIBaseURL is the default base url for the GitHub API.
	APIBaseURL = "https://" + APIDomain
)
View Source
const (
	ErrGithubEventPathEnvNotSet errors.Kind = `environment variable "GITHUB_EVENT_PATH" not set`
	ErrGithubEventUnmarshal     errors.Kind = "failed to unmarshal github event"
	ErrGithubEventMissingPR     errors.Kind = "event does not contain a pull request"
)

Errors for when the GitHub event cannot be read.

Variables

This section is empty.

Functions

func GetEventPR added in v0.5.0

func GetEventPR() (*github.PullRequest, error)

GetEventPR returns the pull request event from the file at GITHUB_EVENT_PATH.

func OIDCToken added in v0.5.0

func OIDCToken(ctx context.Context, cfg OIDCVars) (token string, err error)

OIDCToken requests a new OIDC token.

Types

type OIDCVars

type OIDCVars struct {
	ReqURL   string
	ReqToken string
}

OIDCVars is the variables used for issuing new OIDC tokens.

Jump to

Keyboard shortcuts

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