model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTargetPipeline

func GetTargetPipeline(context EventContext, pipelines []config.PipelineConfig) *config.PipelineConfig

Traverse all pipeline conditions from configuration for the github event. If all conditions are matched then return pipeline

Rules: 1. Github event must be defined at condition allowed event list. 2. If event belongs to fork, fork option must be true at condition. For non-forks, condition is not important. 3. Condition type must be equal to event type (pr/branch or tag) 3. If event belongs to PR, pr option must be true. Otherwise both must be false. 4. If event belongs to branch, branch option must be true. Otherwise both must be false. 5. If event belongs to tag, tag option must be true. Otherwise both must be false. 6. If event belongs to workflow, workflow must be equal to event workflow name. If condition field is empty, rule is skipped. 7. If event belongs to workflow, condition must be equal to event workflow conclusion. If conclusion field is empty, rule is skipped. 8. If event belongs to workflow, status must be equal to event workflow status. If status field is empty, rule is skipped. 9. [Regex]Repository must be matched to events repository name. If repository field is empty, rule is skipped. 10.[Regex]Name must be matched to events reference. If name field is empty, rule is skipped.

Types

type EventContext

type EventContext interface {
	GetAction() string
	GetConclusion() string
	GetEvent() string
	GetInstallationID() int64
	GetName() string
	GetRepository() string
	GetStatus() string
	GetWorkflow() string
	GetWorkflowRunID() int64
	GetCommitHash() string
	GetType() string
	IsFork() bool
	Log()
}

func ConvertPayloadToEventContext

func ConvertPayloadToEventContext(githubEventType string, payload []byte) (EventContext, error)

type PushEventContext

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

func (*PushEventContext) GetAction

func (pec *PushEventContext) GetAction() string

func (*PushEventContext) GetCommitHash

func (pec *PushEventContext) GetCommitHash() string

func (*PushEventContext) GetConclusion

func (pec *PushEventContext) GetConclusion() string

func (*PushEventContext) GetEvent

func (pec *PushEventContext) GetEvent() string

func (*PushEventContext) GetInstallationID

func (pec *PushEventContext) GetInstallationID() int64

func (*PushEventContext) GetName

func (pec *PushEventContext) GetName() string

func (*PushEventContext) GetRepository

func (pec *PushEventContext) GetRepository() string

func (*PushEventContext) GetStatus

func (pec *PushEventContext) GetStatus() string

func (*PushEventContext) GetType

func (pec *PushEventContext) GetType() string

func (*PushEventContext) GetWorkflow

func (pec *PushEventContext) GetWorkflow() string

func (*PushEventContext) GetWorkflowRunID

func (pec *PushEventContext) GetWorkflowRunID() int64

func (*PushEventContext) IsFork

func (pec *PushEventContext) IsFork() bool

func (*PushEventContext) Log

func (pec *PushEventContext) Log()

type WorkflowRunEventContext

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

func (*WorkflowRunEventContext) GetAction

func (wrec *WorkflowRunEventContext) GetAction() string

func (*WorkflowRunEventContext) GetCommitHash

func (wrec *WorkflowRunEventContext) GetCommitHash() string

func (*WorkflowRunEventContext) GetConclusion

func (wrec *WorkflowRunEventContext) GetConclusion() string

func (*WorkflowRunEventContext) GetEvent

func (wrec *WorkflowRunEventContext) GetEvent() string

func (*WorkflowRunEventContext) GetInstallationID

func (wrec *WorkflowRunEventContext) GetInstallationID() int64

func (*WorkflowRunEventContext) GetName

func (wrec *WorkflowRunEventContext) GetName() string

func (*WorkflowRunEventContext) GetRepository

func (wrec *WorkflowRunEventContext) GetRepository() string

func (*WorkflowRunEventContext) GetStatus

func (wrec *WorkflowRunEventContext) GetStatus() string

func (*WorkflowRunEventContext) GetType

func (wrec *WorkflowRunEventContext) GetType() string

func (*WorkflowRunEventContext) GetWorkflow

func (wrec *WorkflowRunEventContext) GetWorkflow() string

func (*WorkflowRunEventContext) GetWorkflowRunID

func (wrec *WorkflowRunEventContext) GetWorkflowRunID() int64

func (*WorkflowRunEventContext) IsFork

func (wrec *WorkflowRunEventContext) IsFork() bool

func (*WorkflowRunEventContext) Log

func (wrec *WorkflowRunEventContext) Log()

Jump to

Keyboard shortcuts

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