inputs

package
v0.0.0-...-88ab25c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitHubEventPath is the path of the file with the complete webhook event payload. For example, /github/workflow/event.json.
	GitHubEventPath = "GITHUB_EVENT_PATH"

	// GitHubWorkspace is the GitHub workspace directory path. The workspace directory is a copy of your repository
	// if your workflow uses the actions/checkout action. If you don't use the actions/checkout action,
	// the directory will be empty. For example, /home/runner/work/my-repo-name/my-repo-name.
	GitHubWorkspace = "GITHUB_WORKSPACE"

	// GitHubAPIURL returns the API URL. For example: https://api.github.com.
	GitHubAPIURL = "GITHUB_API_URL"
)

SEE: https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables

Variables

This section is empty.

Functions

func MaskedActionEnv

func MaskedActionEnv(env ActionEnv) string

Types

type ActionEnv

type ActionEnv struct {
	GitHubToken github.Token
	EventPath   typedpath.RawPath
	Workspace   typedpath.RawPath
	APIURL      string
}

func GetActionEnv

func GetActionEnv(env cli.Env) ActionEnv

type Inputs

type Inputs struct {
	LogLevel string `json:"log_level"`

	TargetPath                typedpath.RawPath `json:"target_path"`
	TargetType                string            `json:"target_type"`
	IgnoreDangling            StringifyBool     `json:"ignore_dangling"`
	IgnoreCase                StringifyBool     `json:"ignore_case"`
	IgnoreSubmodulesAndNested StringifyBool     `json:"ignore_submodules_and_nested"`
	IgnoredFilePath           typedpath.RawPath `json:"ignored_file_path"`

	EnableAutofix              StringifyBool `json:"enable_autofix"`
	CommaSeparatedAutofixGlobs string        `json:"autofix_globs"`

	EnableJUnit  StringifyBool     `json:"enable_junit"`
	JUnitXMLPath typedpath.RawPath `json:"junit_xml_path"`

	EnablePRComment       StringifyBool     `json:"enable_pr_comment"`
	PRCommentTmplFilePath typedpath.RawPath `json:"pr_comment_tmpl_file"`
	PRCommentLang         string            `json:"pr_comment_lang"`
	PRCommentSendSuccess  StringifyBool     `json:"pr_comment_send_success"`
	PRCommentPullNumber   StringifyInt      `json:"pr_comment_pull_number"`
}

type PullRequest

type PullRequest struct {
	Number github.PullNumber `json:"number"`
}

PullRequest is a payload for pull requests. SEE: https://docs.github.com/en/rest/reference/pulls#get-a-pull-request

type PushOrPullRequestEventPayload

type PushOrPullRequestEventPayload struct {
	PullRequest *PullRequest `json:"pull_request,omitempty"`
	Repository  *Repository  `json:"repository,omitempty"`
}

PushOrPullRequestEventPayload is a payload for pull request events. SEE: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request

type ReadEventPayloadFunc

type ReadEventPayloadFunc func(path typedpath.RawPath) (*PushOrPullRequestEventPayload, error)

func NewReadEventPayload

func NewReadEventPayload(logger logging.Logger) ReadEventPayloadFunc

func StubReadEventPayload

func StubReadEventPayload(payload *PushOrPullRequestEventPayload, err error) ReadEventPayloadFunc

type Repository

type Repository struct {
	Name  github.Repo `json:"name"`
	Owner User        `json:"owner"`
}

Repository is a payload for repository. SEE: https://docs.github.com/en/rest/reference/repos#get-a-repository

type StringifyBool

type StringifyBool bool

func (StringifyBool) MarshalJSON

func (s StringifyBool) MarshalJSON() ([]byte, error)

func (*StringifyBool) UnmarshalJSON

func (s *StringifyBool) UnmarshalJSON(bytes []byte) error

type StringifyInt

type StringifyInt int

func (StringifyInt) MarshalJSON

func (s StringifyInt) MarshalJSON() ([]byte, error)

func (*StringifyInt) UnmarshalJSON

func (s *StringifyInt) UnmarshalJSON(bytes []byte) error

type TargetType

type TargetType string
const (
	TargetTypeAuto            TargetType = "auto-detect"
	TargetTypeUnityProj       TargetType = "unity-project"
	TargetTypeUnityProjSubDir TargetType = "unity-project-sub-dir"
	TargetTypeUpmPackage      TargetType = "upm-package"
)

func ValidateTargetType

func ValidateTargetType(unsafeTargetType string) (TargetType, error)

type User

type User struct {
	Login github.Owner `json:"login"`
}

User is a payload for users.

Jump to

Keyboard shortcuts

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