github

package
v0.4.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 20 Imported by: 1 module, 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 (
	ErrInstallationLifecycleAuthentication = xerror.New(xerror.KindUnauthorized, "GITHUB_APP_LIFECYCLE_AUTHENTICATION_FAILED", "GitHub App lifecycle authentication failed")
	ErrInstallationLifecycleIgnored        = xerror.New(xerror.KindInvalidInput, "GITHUB_APP_LIFECYCLE_IGNORED", "GitHub App lifecycle event is not handled")
	ErrInstallationLifecycleTooLarge       = xerror.New(xerror.KindInvalidInput, "GITHUB_APP_LIFECYCLE_TOO_LARGE", "GitHub App lifecycle payload is too large")
)

Functions

func VerifyChangeWebhook

func VerifyChangeWebhook(secret []byte, signature, event, deliveryID string, body []byte) (gitprovider.VerifiedChangeEvent, error)

VerifyChangeWebhook authenticates and normalizes a GitHub pull-request event. The webhook is only a low-latency signal; upsert processing re-reads the pull request from GitHub before trusting its current head or state. Pipeline paths are resolved later from Braidplane-owned mappings.

Types

type Client

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

Client wraps GitHub pull request APIs behind Braidplane's provider proposal contract.

func New

New creates a GitHub provider proposal client.

func (*Client) BootstrapRepository

func (c *Client) BootstrapRepository(
	ctx context.Context,
	req gitprovider.RepositoryBootstrapRequest,
) (result *gitprovider.RepositoryBootstrapResult, resultErr error)

BootstrapRepository creates a private GitHub repository with the exact initial template.

func (*Client) CreateProposal

func (c *Client) CreateProposal(
	ctx context.Context,
	req gitprovider.ProposalRequest,
) (*gitprovider.ProposalRef, error)

CreateProposal creates a GitHub pull request.

func (*Client) DeleteRepository

func (c *Client) DeleteRepository(ctx context.Context, repositoryID string) error

DeleteRepository removes the exact bootstrap repository identified by its immutable ID.

func (*Client) GetProposal

GetProposal returns one pull request, including closed and merged states.

func (*Client) ListOpenProposals

func (c *Client) ListOpenProposals(
	ctx context.Context,
	req gitprovider.ProposalListRequest,
) ([]gitprovider.ProposalRef, error)

ListOpenProposals returns open pull requests for the requested source/target branches.

func (*Client) PublishProofCheck

func (c *Client) PublishProofCheck(ctx context.Context, check gitprovider.ProofCheck) error

PublishProofCheck idempotently projects one sanitized receipt onto its exact commit.

func (*Client) UpdateProposal

UpdateProposal updates a GitHub pull request title and body.

func (*Client) ValidateRepository

func (c *Client) ValidateRepository(ctx context.Context, branch string) error

ValidateRepository verifies repository access and the exact branch selected for onboarding.

type InstallationLifecycleEvent

type InstallationLifecycleEvent struct {
	DeliveryID     string
	Action         string
	InstallationID int64
	Added          []InstallationRepository
	Removed        []int64
}

func VerifyInstallationLifecycleWebhook

func VerifyInstallationLifecycleWebhook(secret []byte, signature, event, deliveryID string, body []byte) (InstallationLifecycleEvent, error)

type InstallationRepository

type InstallationRepository struct {
	ID         int64
	FullName   string
	OwnerLogin string
	Name       string
}

Jump to

Keyboard shortcuts

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