core

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FilterTriggers    = []string{}
	FilterRun         = false
	Internetavailable = true
	DebugRules        = false
	RulesSwitch       = map[string]bool{
		"dangerous-action":       true,
		"dangerous-checkout":     true,
		"expression-injection":   true,
		"dangerous-write":        true,
		"local-action":           true,
		"repo-jacking":           true,
		"shellcheck":             true,
		"credentials":            true,
		"runner-label":           true,
		"dangerous-artefact":     true,
		"unsecure-commands":      true,
		"known-vulnerability":    true,
		"bot-check":              true,
		"debug-external-trigger": true,
		"debug-artefacts":        true,
		"debug-js-exec":          true,
		"debug-oidc-action":      true,
	}
)

not optimal but I can't pass other parameters to OnRulesCreated

Functions

func DisplayErrors added in v0.1.2

func DisplayErrors(writer io.Writer, format string, errs []*actionlint.Error) error

Everything is stolen from here: https://github.com/rhysd/actionlint/blob/main/docs/usage.md#format Again thanks @rhysd for the great work.

func FilterRules

func FilterRules(include bool, rulesFiltered []string)

func OnRulesCreated

func OnRulesCreated(rules []actionlint.Rule) []actionlint.Rule

Types

type GitHub

type GitHub struct {
	// contains filtered or unexported fields
}

func NewGitHub

func NewGitHub(opts GitHubOptions) *GitHub

func (*GitHub) Download

func (gh *GitHub) Download() error

func (*GitHub) DownloadContentFromBranch

func (gh *GitHub) DownloadContentFromBranch(repo string, branch string) error

func (*GitHub) DownloadContentFromBranches

func (gh *GitHub) DownloadContentFromBranches(repository *github.Repository, branches []string) error

func (*GitHub) DownloadRepo

func (gh *GitHub) DownloadRepo(repository *github.Repository) error

type GitHubOptions

type GitHubOptions struct {
	Proxy             bool
	Token             string
	Path              string
	Org               string
	Repo              string
	OutputDir         string
	DefaultBranchOnly bool
	MaxBranches       int
	IncludeArchives   bool
	IncludeForks      bool
}

type OctoLinter

type OctoLinter struct {
	actionlint.Linter
}

func (*OctoLinter) LintRepositoryRecurse

func (l *OctoLinter) LintRepositoryRecurse(dir string) ([]*actionlint.Error, error)

LintRepositoryRecurse search for all GitHub project recursively and run the linter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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