scanner

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasWorkflowDispatch

func HasWorkflowDispatch(content string) bool

HasWorkflowDispatch checks if workflow_dispatch is in the on: section.

func ParseAnnotations

func ParseAnnotations(content string) []string

ParseAnnotations extracts cron annotations from workflow file content.

Types

type ScanResult

type ScanResult struct {
	Annotations []github.CronAnnotation
	Skipped     []SkippedAnnotation
}

ScanResult holds the scan results.

type Scanner

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

Scanner scans repositories for cron annotations.

func New

func New(client ScannerClient) *Scanner

New creates a new Scanner.

func (*Scanner) ScanAll

func (s *Scanner) ScanAll(ctx context.Context) (*ScanResult, error)

ScanAll scans all installation repositories and collects annotations.

type ScannerClient

type ScannerClient interface {
	GetInstallationRepos(ctx context.Context) ([]github.Repository, error)
	GetWorkflowFiles(ctx context.Context, owner, repo string) ([]github.WorkflowFile, error)
	GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, error)
}

ScannerClient is the GitHub API interface used by the scanner.

type SkippedAnnotation added in v0.2.0

type SkippedAnnotation struct {
	Owner        string `json:"owner"`
	Repo         string `json:"repo"`
	WorkflowFile string `json:"workflow_file"`
	CronExpr     string `json:"cron_expr"`
	Reason       string `json:"reason"`
}

SkippedAnnotation holds info about an annotation that failed validation.

Jump to

Keyboard shortcuts

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