cmd

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToWorkflowLintInfo

func ToWorkflowLintInfo(
	wfInfoList []*workflow.WorkflowInfo,
	config *workflow.ActionArmorConfigFile,
	gitExecutor gitexec.GitExecutor,
	flags LinterFlags,
) ([]linter.WorkflowLintInfo, error)

ToWorkflowLintInfo converts a list of WorkflowInfo to a list of WorkflowLintInfo.

Types

type CacheFlags

type CacheFlags struct {
	CacheDirPath string
	CacheTTLStr  string
	NoCache      bool
}

type Environment

type Environment struct {
	Logger      *slog.Logger
	EoeParams   *eoe.ExitOnErrorParams
	GqlClient   *api.GraphQLClient
	GitExecutor gitexec.GitExecutor
	GdExecutor  gitdescribe.Executor
	Linter      linter.Linter
}

func Execute

func Execute() (*Environment, []*linter.Error)

func NewEnvironment

func NewEnvironment(ctx context.Context, logLevel slog.Level, flags *CacheFlags) (*Environment, error)

type Flags

type Flags struct {
	RunFlags
	CacheFlags
	LinterFlags
}

func NewFlags

func NewFlags(toolName string, newFlagSetFuncs []NewFlagSetFunc) (*Flags, []string, error)

type LinterFlags

type LinterFlags struct {
	ExcludeOfficialActions   bool
	ExcludeVerifiedCreators  bool
	AllowOnlyAllowlistedHash bool
	AllowArchivedRepo        bool
	EnforcePinHash           bool
	EnforceVerifiedOrg       bool

	CreatorAllowlist []string
	ActionAllowlist  []string
}

type NamedFlagSet

type NamedFlagSet struct {
	Name    string
	FlagSet *pflag.FlagSet
}

NamedFlagSet represents a named pflag.FlagSet

func NewCacheFlagSet

func NewCacheFlagSet(flags *Flags) *NamedFlagSet

func NewLinterFlagSet

func NewLinterFlagSet(flags *Flags) *NamedFlagSet

func NewRunFlagSet

func NewRunFlagSet(flags *Flags) *NamedFlagSet

type NewFlagSetFunc

type NewFlagSetFunc func(*Flags) *NamedFlagSet

type RunFlags

type RunFlags struct {
	ConfigFilePath string
	LogLevelStr    string
	NumWorkers     int64
}

Jump to

Keyboard shortcuts

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