options

package
v0.0.0-...-b387701 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package options defines the reusable option sets of the pinpoint commands.

Index

Constants

View Source
const (
	FormatSPDX      = "spdx"
	FormatCycloneDX = "cyclonedx"
)

The SBOM formats the status subcommand can write.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Scan

	// Attest makes pinpoint write the scan results as an in-toto
	// attestation instead of the human readable output.
	Attest bool

	// Update makes pinpoint look up the latest release of the actions to
	// report the references that have a newer version available.
	Update bool

	// Offline stops pinpoint from calling the forge at all: no versions
	// are resolved and no repository is checked for being a fork.
	Offline bool
}

Check groups the options of the subcommand that reports on the pinning status of the action references.

func (*Check) AddFlags

func (co *Check) AddFlags(cmd *cobra.Command)

AddFlags adds the check flags to a command.

type Pin

type Pin struct {
	Scan

	// All makes pinpoint look at every action reference instead of only
	// the unpinned ones. It also widens the scan to the action definitions
	// in the repository.
	All bool

	// Update makes pinpoint pin the references to the latest release of
	// each action instead of to the version they already track. It is the
	// counterpart of the update reporting of the check subcommand.
	Update bool

	// Yes writes the changes without asking for confirmation first.
	Yes bool
}

Pin groups the options of the subcommand that rewrites the action references to pin them to a commit hash.

func (*Pin) AddFlags

func (po *Pin) AddFlags(cmd *cobra.Command)

AddFlags adds the pin flags to a command.

type Scan

type Scan struct {

	// Path is the directory pinpoint looks in for workflows. It is read
	// from the command arguments, not from a flag.
	Path string
	// contains filtered or unexported fields
}

Scan groups the options shared by the commands that scan a repository for GitHub Actions workflows.

func (*Scan) AddFlags

func (so *Scan) AddFlags(_ *cobra.Command)

AddFlags adds the scanner flags to a command. The API token is read from the environment, never from a flag: tokens on a command line leak into the shell history and the process list.

func (*Scan) Config

func (so *Scan) Config() *command.OptionsSetConfig

Config returns the flag configuration of the scanner options.

func (*Scan) Validate

func (so *Scan) Validate() error

Validate checks that the scanner options are usable.

type Status

type Status struct {
	Scan

	// Format switches the output from the table to an SBOM in this format:
	// spdx or cyclonedx. Empty renders the table.
	Format string

	// Offline stops pinpoint from calling the forge: no versions are
	// resolved, so only the pinning status is reported.
	Offline bool
}

Status groups the options of the subcommand that shows the pinning and update status of every action reference.

func (*Status) AddFlags

func (st *Status) AddFlags(cmd *cobra.Command)

AddFlags adds the status flags to a command.

func (*Status) Validate

func (st *Status) Validate() error

Validate checks that the status options are usable.

Jump to

Keyboard shortcuts

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