handler

package
v0.0.0-...-c530903 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClosedConstant string = "closed"
)

Variables

View Source
var DCO string = "DCO"

DCO is the check name

Functions

func CheckIssueTemplateHeadings

func CheckIssueTemplateHeadings(req types.IssuesOuter, derekConfig *types.DerekRepoConfig, config config.Config) error

func EnabledFeature

func EnabledFeature(attemptedFeature string, config *types.DerekRepoConfig) bool

func GetPrivateRepoConfig

func GetPrivateRepoConfig(owner, repository, branch string, installation int, config config.Config) (*types.DerekRepoConfig, error)

GetPrivateRepoConfig returns the configuration for derek for the specified repository. Since the repository is private we use the github API to fetch `.DEREK.yml`.

func GetRepoConfig

func GetRepoConfig(owner, repository, branch string) (*types.DerekRepoConfig, error)

GetRepoConfig returns derek's configuration for the specified repository. The repository has to be public since this function will fetch the file from the CDN. If you are trying to fetch the config from a private repo use `GetPrivateRepoConfig` instead.

func HandleComment

func HandleComment(req types.IssueCommentOuter, config config.Config, derekConfig *types.DerekRepoConfig)

HandleComment handles a comment

func HandleFirstTimerPR

func HandleFirstTimerPR(req types.PullRequestOuter, contributingURL string, config config.Config) (bool, error)

func HandleHacktoberfestPR

func HandleHacktoberfestPR(req types.PullRequestOuter, contributingURL string, config config.Config) (bool, error)

HandleHacktoberfestPR checks for opened PR, first time contributor. If only .MD files are changed, issue is closed and invalid label is added The goal of this function is to mark pull requests invalid and close them from people only making typo changes without signing their commit (flybys)

func HandlePullRequest

func HandlePullRequest(req types.PullRequestOuter, contributingURL string, config config.Config)

func PermittedUserFeature

func PermittedUserFeature(attemptedFeature string, config *types.DerekRepoConfig, user string) bool

func VerifyPullRequestDescription

func VerifyPullRequestDescription(req types.PullRequestOuter, contributingURL string, config config.Config)

VerifyPullRequestDescription checks that the PR has anything in the body. If there is no body, a label is added and comment posted to the PR with a link to the contributing guide.

Types

type ReleaseHandler

type ReleaseHandler interface {
	Handle(github.ReleaseEvent) error
}

func NewReleaseHandler

func NewReleaseHandler(config config.Config, installationID int) ReleaseHandler

type UpdatingReleaseHandler

type UpdatingReleaseHandler struct {
	Config         config.Config
	InstallationID int
}

func (*UpdatingReleaseHandler) Handle

type WorkingRelease

type WorkingRelease struct {
	CurrentTag     string
	CurrentDate    time.Time
	CurrentRelease *github.RepositoryRelease

	PreviousTag  string
	PreviousDate time.Time
}

Jump to

Keyboard shortcuts

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