github

package
v0.0.0-...-4c3a8da Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Actions = env{}

Functions

func LoadEvent

func LoadEvent(ctx context.Context) (*event.Detail, error)

func LoadTestEvent

func LoadTestEvent(ctx context.Context, env TestEnv) (*event.Detail, error)

func ParseFile

func ParseFile(ctx context.Context, p *message.Printer, event string, payloadPath string) (*event.Detail, error)

func ParseWorkflow

func ParseWorkflow(ctx context.Context, p *message.Printer) (*event.Detail, error)

func Report

func Report(ctx context.Context, p *message.Printer, workflow, status, runID string, payload io.Reader) (*event.Detail, error)

func ReportFile

func ReportFile(ctx context.Context, p *message.Printer, workflow, status, runID, payloadPath string) (*event.Detail, error)

func ReportWorkflowStatus

func ReportWorkflowStatus(ctx context.Context, p *message.Printer, status string) (*event.Detail, error)

Types

type CheckRun

type CheckRun struct {
	Common
	CheckRun struct {
		Name   string
		Output struct {
			Title   string
			Summary string
		}
		CheckSuite struct {
			App struct {
				Name      string
				AvatarURL string `json:"avatar_url"`
			}
			HeadBranch string `json:"head_branch"`
			HeadSHA    string `json:"head_sha"`
		} `json:"check_suite"`
	} `json:"check_run"`
}

func (CheckRun) Event

func (ev CheckRun) Event(p *message.Printer) *event.Detail

type Common

type Common struct {
	Action string
	Sender struct {
		Login     string
		AvatarURL string `json:"avatar_url"`
	}
	Repository struct {
		FullName      string `json:"full_name"`
		DefaultBranch string `json:"default_branch"`
		URL           string `json:"html_url"`
	}
	Organization struct {
		Login string
	}
	Ref        string
	HeadCommit struct {
		ID  string
		URL string
	} `json:"head_commit"`
}

type Create

type Create struct {
	Common
	RefType string `json:"ref_type"`
}

func (Create) Event

func (ev Create) Event(p *message.Printer) *event.Detail

type Delete

type Delete struct {
	Common
	RefType string `json:"ref_type"`
}

func (Delete) Event

func (ev Delete) Event(p *message.Printer) *event.Detail

type JobStatus

type JobStatus struct {
	Common
	JobName   string
	JobStatus string
	JobURL    string
}

func (JobStatus) Event

func (ev JobStatus) Event(p *message.Printer) *event.Detail

type PullRequest

type PullRequest struct {
	Common
	PullRequest struct {
		Number int
		Title  string
		Draft  bool
		Head   struct {
			Ref string
		}
		Base struct {
			Ref string
		}
		URL    string `json:"html_url"`
		Body   string
		Merged bool
	} `json:"pull_request"`
}

func (PullRequest) Event

func (ev PullRequest) Event(p *message.Printer) *event.Detail

type PullRequestReview

type PullRequestReview struct {
	Common
	PullRequest struct {
		Number int
		Title  string
		URL    string `json:"html_url"`
	} `json:"pull_request"`
	Review struct {
		State string
		URL   string `json:"html_url"`
	}
}

func (*PullRequestReview) Event

func (ev *PullRequestReview) Event(p *message.Printer) *event.Detail

type PullRequestReviewComment

type PullRequestReviewComment struct{}

func (PullRequestReviewComment) Event

type Push

type Push struct {
	Common
	Before, After string
	CompareURL    string `json:"compare_url"`
	Commits       []struct {
		ID      string
		URL     string
		Message string
		Author  struct {
			Name string
		}
		Distinct bool
	}
	Pusher struct {
		Name string
	}
	Forced bool
}

func (Push) Event

func (ev Push) Event(p *message.Printer) *event.Detail

type TestEnv

type TestEnv struct {
	RunID        string
	EventName    string
	WorkflowName string
	EventPath    string
	JobStatus    string
	Lang         string
}

Jump to

Keyboard shortcuts

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