utils

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitHub Actions Event Names.
	EventIssueComment      = "issue_comment"
	EventPullRequest       = "pull_request"
	EventPullRequestTarget = "pull_request_target"
	EventWorkflowDispatch  = "workflow_dispatch"

	// Pull Request States.
	PRStateOpen   = "open"
	PRStateClosed = "closed"
)

GitHub API const.

Variables

This section is empty.

Functions

func AddStatusNode

func AddStatusNode(b bool, desc string, details treeprint.Tree) bool

func GetPRNumFromActionsCtx

func GetPRNumFromActionsCtx(actionCtx *githubactions.GitHubContext) (int, error)

Retrieve PR number from GitHub Actions context.

func IndexMap

func IndexMap(m map[string]any, keys ...string) any

Recursively search for nested values using the keys provided.

func TestLastNodeStatus

func TestLastNodeStatus(t *testing.T, success bool, details treeprint.Tree) bool

Types

type PRList

type PRList []int

Type used to (un)marshal input/output for check and matrix subcommands.

func (PRList) MarshalText

func (p PRList) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler.

func (*PRList) UnmarshalText

func (p *PRList) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type Status

type Status string
const (
	Success Status = "🟢"
	Fail    Status = "🔴"
)

Jump to

Keyboard shortcuts

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