reporulesetbot

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreated              = "created"
	ActionEdited               = "edited"
	ActionDeleted              = "deleted"
	ActionReleased             = "released"
	EventTypeRepositoryRuleset = "repository_ruleset"
	EventTypeInstallation      = "installation"
	EventTypeRelease           = "release"
)

Constants for action and event types

Variables

This section is empty.

Functions

This section is empty.

Types

type Changes

type Changes struct {
	Name struct {
		From string `json:"from,omitempty"`
	} `json:"name,omitempty"`
	Enforcement struct {
		From string `json:"from,omitempty"`
	} `json:"enforcement,omitempty"`
}

Changes represents the changes in a ruleset event.

type Config

type Config struct {
	Server HTTPConfig       `yaml:"server"`
	Github githubapp.Config `yaml:"github"`
}

Config represents the configuration of the application.

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads and parses the configuration file.

type HTTPConfig

type HTTPConfig struct {
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
}

HTTPConfig represents the configuration of the HTTP server.

type RulesetEvent

type RulesetEvent struct {
	Enterprise   *github.Enterprise   `json:"enterprise,omitempty"`
	Organization *github.Organization `json:"organization,omitempty"`
	Repository   *github.Repository   `json:"repository,omitempty"`
	Action       string               `json:"action,omitempty"`
	Installation *github.Installation `json:"installation,omitempty"`
	Sender       *github.User         `json:"sender,omitempty"`
	Ruleset      *github.Ruleset      `json:"repository_ruleset,omitempty"`
	Changes      *Changes             `json:"changes,omitempty"`
}

RulesetEvent represents a GitHub ruleset event.

type RulesetHandler

type RulesetHandler struct {
	githubapp.ClientCreator
	zerolog.Logger
}

RulesetHandler handles ruleset events.

func (*RulesetHandler) Handle

func (h *RulesetHandler) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error

Handle processes the event payload based on the event type.

func (*RulesetHandler) Handles

func (h *RulesetHandler) Handles() []string

Handles returns the list of event types handled by the RulesetHandler.

type Workflow

type Workflow struct {
	RepositoryID int64  `json:"repository_id"`
	Path         string `json:"path"`
	Ref          string `json:"ref"`
}

Workflow represents a workflow.

type Workflows

type Workflows struct {
	Workflows []Workflow `json:"workflows"`
}

Workflows represents the ruleset workflows parameters.

Jump to

Keyboard shortcuts

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