github

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubAppPEM           = "pem"
	GitHubAppClientSecret  = "clientSecret"
	GitHubAppWebhookSecret = "webhookSecret"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx core.AppInstallationContext, ghAppID int64, installationID string) (*github.Client, error)

Types

type Configuration

type Configuration struct {
	Organization string `json:"organization"`
}

type GitHub

type GitHub struct {
}

func (*GitHub) CleanupWebhook

func (g *GitHub) CleanupWebhook(ctx core.AppInstallationContext, options core.WebhookOptions) error

func (*GitHub) CompareWebhookConfig

func (g *GitHub) CompareWebhookConfig(a, b any) (bool, error)

func (*GitHub) Components

func (g *GitHub) Components() []core.Component

func (*GitHub) Configuration

func (g *GitHub) Configuration() []configuration.Field

func (*GitHub) Description

func (g *GitHub) Description() string

func (*GitHub) HandleRequest

func (g *GitHub) HandleRequest(ctx core.HTTPRequestContext)

func (*GitHub) Icon

func (g *GitHub) Icon() string

func (*GitHub) Label

func (g *GitHub) Label() string

func (*GitHub) Name

func (g *GitHub) Name() string

func (*GitHub) SetupWebhook

func (g *GitHub) SetupWebhook(ctx core.AppInstallationContext, options core.WebhookOptions) (any, error)

func (*GitHub) Sync

func (g *GitHub) Sync(ctx core.SyncContext) error

func (*GitHub) Triggers

func (g *GitHub) Triggers() []core.Trigger

type GitHubAppData

type GitHubAppData struct {
	ID            int64  `mapstructure:"id" json:"id"`
	Slug          string `mapstructure:"slug" json:"slug"`
	ClientID      string `mapstructure:"client_id" json:"client_id"`
	ClientSecret  string `mapstructure:"client_secret" json:"client_secret"`
	WebhookSecret string `mapstructure:"webhook_secret" json:"webhook_secret"`
	PEM           string `mapstructure:"pem" json:"pem"`
}

* This is the response GitHub sends back after the GitHub app is created. * NOTE: this contains sensitive data, so we should not save this as part * of the installation metadata.

type GitHubAppMetadata

type GitHubAppMetadata struct {
	ID       int64  `mapstructure:"id" json:"id"`
	Slug     string `mapstructure:"slug" json:"slug"`
	ClientID string `mapstructure:"clientId" json:"clientId"`
}

type Metadata

type Metadata struct {
	InstallationID string            `mapstructure:"installationId" json:"installationId"`
	State          string            `mapstructure:"state" json:"state"`
	Owner          string            `mapstructure:"owner" json:"owner"`
	Repositories   []Repository      `mapstructure:"repositories" json:"repositories"`
	GitHubApp      GitHubAppMetadata `mapstructure:"githubApp" json:"githubApp"`
}

type OnIssue

type OnIssue struct{}

func (*OnIssue) Actions

func (i *OnIssue) Actions() []core.Action

func (*OnIssue) Color

func (i *OnIssue) Color() string

func (*OnIssue) Configuration

func (i *OnIssue) Configuration() []configuration.Field

func (*OnIssue) Description

func (i *OnIssue) Description() string

func (*OnIssue) HandleAction

func (i *OnIssue) HandleAction(ctx core.TriggerActionContext) error

func (*OnIssue) HandleWebhook

func (i *OnIssue) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnIssue) Icon

func (i *OnIssue) Icon() string

func (*OnIssue) Label

func (i *OnIssue) Label() string

func (*OnIssue) Name

func (i *OnIssue) Name() string

func (*OnIssue) Setup

func (i *OnIssue) Setup(ctx core.TriggerContext) error

type OnIssueConfiguration

type OnIssueConfiguration struct {
	Repository string   `json:"repository"`
	Actions    []string `json:"action"`
}

type OnIssueMetadata

type OnIssueMetadata struct {
	Repository *Repository `json:"repository"`
}

type OnPullRequest

type OnPullRequest struct{}

func (*OnPullRequest) Actions

func (p *OnPullRequest) Actions() []core.Action

func (*OnPullRequest) Color

func (p *OnPullRequest) Color() string

func (*OnPullRequest) Configuration

func (p *OnPullRequest) Configuration() []configuration.Field

func (*OnPullRequest) Description

func (p *OnPullRequest) Description() string

func (*OnPullRequest) HandleAction

func (p *OnPullRequest) HandleAction(ctx core.TriggerActionContext) error

func (*OnPullRequest) HandleWebhook

func (p *OnPullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnPullRequest) Icon

func (p *OnPullRequest) Icon() string

func (*OnPullRequest) Label

func (p *OnPullRequest) Label() string

func (*OnPullRequest) Name

func (p *OnPullRequest) Name() string

func (*OnPullRequest) Setup

func (p *OnPullRequest) Setup(ctx core.TriggerContext) error

type OnPullRequestConfiguration

type OnPullRequestConfiguration struct {
	Repository string   `json:"repository"`
	Actions    []string `json:"action"`
}

type OnPullRequestMetadata

type OnPullRequestMetadata struct {
	Repository *Repository `json:"repository"`
}

type OnPush

type OnPush struct{}

func (*OnPush) Actions

func (p *OnPush) Actions() []core.Action

func (*OnPush) Color

func (p *OnPush) Color() string

func (*OnPush) Configuration

func (p *OnPush) Configuration() []configuration.Field

func (*OnPush) Description

func (p *OnPush) Description() string

func (*OnPush) HandleAction

func (p *OnPush) HandleAction(ctx core.TriggerActionContext) error

func (*OnPush) HandleWebhook

func (p *OnPush) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnPush) Icon

func (p *OnPush) Icon() string

func (*OnPush) Label

func (p *OnPush) Label() string

func (*OnPush) Name

func (p *OnPush) Name() string

func (*OnPush) Setup

func (p *OnPush) Setup(ctx core.TriggerContext) error

type OnPushConfiguration

type OnPushConfiguration struct {
	Repository string                    `json:"repository"`
	Refs       []configuration.Predicate `json:"refs"`
}

type OnPushMetadata

type OnPushMetadata struct {
	Repository *Repository `json:"repository"`
}

type OnRelease

type OnRelease struct{}

func (*OnRelease) Actions

func (r *OnRelease) Actions() []core.Action

func (*OnRelease) Color

func (r *OnRelease) Color() string

func (*OnRelease) Configuration

func (r *OnRelease) Configuration() []configuration.Field

func (*OnRelease) Description

func (r *OnRelease) Description() string

func (*OnRelease) HandleAction

func (r *OnRelease) HandleAction(ctx core.TriggerActionContext) error

func (*OnRelease) HandleWebhook

func (r *OnRelease) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnRelease) Icon

func (r *OnRelease) Icon() string

func (*OnRelease) Label

func (r *OnRelease) Label() string

func (*OnRelease) Name

func (r *OnRelease) Name() string

func (*OnRelease) Setup

func (r *OnRelease) Setup(ctx core.TriggerContext) error

type OnReleaseConfiguration

type OnReleaseConfiguration struct {
	Repository string   `json:"repository"`
	Actions    []string `json:"action"`
}

type OnReleaseMetadata

type OnReleaseMetadata struct {
	Repository *Repository `json:"repository"`
}

type Repository

type Repository struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

type Webhook

type Webhook struct {
	ID          int64  `json:"id"`
	WebhookName string `json:"name"`
}

type WebhookConfiguration

type WebhookConfiguration struct {
	EventType  string `json:"eventType"`
	Repository string `json:"repository"`
}

Jump to

Keyboard shortcuts

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