Documentation
¶
Index ¶
- func GetTargetPipeline(context EventContext, pipelines []config.PipelineConfig) *config.PipelineConfig
- type EventContext
- type PushEventContext
- func (pec *PushEventContext) GetAction() string
- func (pec *PushEventContext) GetCommitHash() string
- func (pec *PushEventContext) GetConclusion() string
- func (pec *PushEventContext) GetEvent() string
- func (pec *PushEventContext) GetInstallationID() int64
- func (pec *PushEventContext) GetName() string
- func (pec *PushEventContext) GetRepository() string
- func (pec *PushEventContext) GetStatus() string
- func (pec *PushEventContext) GetType() string
- func (pec *PushEventContext) GetWorkflow() string
- func (pec *PushEventContext) GetWorkflowRunID() int64
- func (pec *PushEventContext) IsFork() bool
- func (pec *PushEventContext) Log()
- type WorkflowRunEventContext
- func (wrec *WorkflowRunEventContext) GetAction() string
- func (wrec *WorkflowRunEventContext) GetCommitHash() string
- func (wrec *WorkflowRunEventContext) GetConclusion() string
- func (wrec *WorkflowRunEventContext) GetEvent() string
- func (wrec *WorkflowRunEventContext) GetInstallationID() int64
- func (wrec *WorkflowRunEventContext) GetName() string
- func (wrec *WorkflowRunEventContext) GetRepository() string
- func (wrec *WorkflowRunEventContext) GetStatus() string
- func (wrec *WorkflowRunEventContext) GetType() string
- func (wrec *WorkflowRunEventContext) GetWorkflow() string
- func (wrec *WorkflowRunEventContext) GetWorkflowRunID() int64
- func (wrec *WorkflowRunEventContext) IsFork() bool
- func (wrec *WorkflowRunEventContext) Log()
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()