common

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func EnsureRepoInMetadata

func EnsureRepoInMetadata(ctx core.MetadataWriter, app core.IntegrationContext, configuration any) error

func ExtractAction

func ExtractAction(data map[string]any) (string, bool)

func FindSecret

func FindSecret(ctx core.IntegrationContext, secretName string) (string, error)

func NewClient

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

func SanitizeAssignees

func SanitizeAssignees(assignees []string) []string

func VerifySignature

func VerifySignature(ctx core.WebhookRequestContext) (int, error)

func WhitelistedAction

func WhitelistedAction(data map[string]any, allowed []string) bool

func WithWebhookLogger

func WithWebhookLogger(ctx core.WebhookRequestContext, triggerName string) core.WebhookRequestContext

Types

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 NodeMetadata

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

type Repository

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

type WebhookConfiguration

type WebhookConfiguration struct {
	EventType  string   `json:"eventType"`
	EventTypes []string `json:"eventTypes"` // Multiple event types (takes precedence over EventType if set)
	Repository string   `json:"repository"`
}

Jump to

Keyboard shortcuts

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