githubprovider

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package githubprovider implements a provider for GitHub API operations.

It supports read operations (repos, files, issues, PRs, releases, branches, tags) via the GitHub GraphQL API, write operations (issues, PRs, commits, branches, tags) via GraphQL mutations, and release writes via the REST API (no GraphQL mutation exists).

Commit operations use the createCommitOnBranch GraphQL mutation which produces GPG-signed commits automatically — no local key management required.

Authentication is handled automatically using the configured GitHub auth handler.

Index

Constants

View Source
const ProviderName = "github"

ProviderName is the registered name for this provider.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubProvider

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

GitHubProvider implements GitHub API operations as a provider.

func NewGitHubProvider

func NewGitHubProvider(opts ...Option) *GitHubProvider

NewGitHubProvider creates a new GitHub API provider.

func (*GitHubProvider) Descriptor

func (p *GitHubProvider) Descriptor() *provider.Descriptor

Descriptor returns the provider metadata, schema, and capabilities.

func (*GitHubProvider) Execute

func (p *GitHubProvider) Execute(ctx context.Context, input any) (*provider.Output, error)

Execute runs the requested GitHub API operation.

type GraphQLError

type GraphQLError struct {
	Errors []graphqlError
}

GraphQLError is returned when the GraphQL API returns errors in the response body.

func (*GraphQLError) Error

func (e *GraphQLError) Error() string

Error implements the error interface.

type Option

type Option func(*GitHubProvider)

Option configures a GitHubProvider.

func WithClient

func WithClient(c *httpc.Client) Option

WithClient sets a custom httpc.Client (useful for testing).

func WithRetryConfig added in v0.9.0

func WithRetryConfig(commitMaxAttempts int, commitRetryBackoff time.Duration, waitMaxAttempts int, waitPollInterval time.Duration, initRepoMaxRetries int, initRepoRetryBackoff time.Duration) Option

WithRetryConfig overrides the default retry timing (useful for testing). Attempt counts are clamped to a minimum of 1; durations are clamped to >= 0.

Jump to

Keyboard shortcuts

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