common

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProvenanceV02Type is the SLSA v0.2 predicate type.
	ProvenanceV02Type = "https://slsa.dev/provenance/v0.2"

	// ProvenanceV1Type is the SLSA v1.0 predicate type.
	ProvenanceV1Type = slsa1.PredicateSLSAProvenance
)

Variables

View Source
var (
	// GenericGeneratorBuilderID is the builder ID for the Generic Generator.
	GenericGeneratorBuilderID = trustedBuilderRepository + "/.github/workflows/generator_generic_slsa3.yml"
	// ContainerGeneratorBuilderID is the builder ID for the Container Generator.
	ContainerGeneratorBuilderID = trustedBuilderRepository + "/.github/workflows/generator_container_slsa3.yml"
	// GoBuilderID is the SLSA builder ID for the Go Builder.
	GoBuilderID = trustedBuilderRepository + "/.github/workflows/builder_go_slsa3.yml"
	// ContainerBasedBuilderID is the SLSA builder ID for the Container-Based Builder.
	ContainerBasedBuilderID = trustedBuilderRepository + "/.github/workflows/builder_container-based_slsa3.yml"

	// NpmCLILegacyBuilderID is the legacy builder ID for the npm CLI.
	NpmCLILegacyBuilderID = "https://github.com/actions/runner"
	// NpmCLIHostedBuilderID is the builder ID for the npm CLI on Hosted GitHub Actions.
	NpmCLIHostedBuilderID = NpmCLILegacyBuilderID + "/github-hosted"
	// NpmCLISelfHostedBuilderID is the builder ID for the npm CLI on Self-hosted GitHub Actions.
	NpmCLISelfHostedBuilderID = NpmCLILegacyBuilderID + "/self-hosted"

	// GenericDelegatorBuilderID is the SLSA builder ID for the BYOB Generic Low-Permissions Delegated Builder.
	GenericDelegatorBuilderID = trustedBuilderRepository + "/.github/workflows/delegator_generic_slsa3.yml"
	// GenericLowPermsDelegatorBuilderID is the SLSA builder ID for the BYOB Generic Low-Permissions Delegated Builder.
	GenericLowPermsDelegatorBuilderID = trustedBuilderRepository + "/.github/workflows/delegator_lowperms-generic_slsa3.yml"
)
View Source
var (
	// BYOBBuildTypeV0 is the base buildType for BYOB delegated builders.
	BYOBBuildTypeV0 = "https://github.com/slsa-framework/slsa-github-generator/delegator-generic@v0"

	// ContainerBasedBuildTypeV01Draft is the buildType for the container-based builder.
	ContainerBasedBuildTypeV01Draft = "https://slsa.dev/container-based-build/v0.1?draft"

	// GoBuilderBuildTypeV1 is the buildType for the Go builder.
	GoBuilderBuildTypeV1 = "https://github.com/slsa-framework/slsa-github-generator/go@v1"

	// GenericGeneratorBuildTypeV1 is the buildType for the generic generator.
	GenericGeneratorBuildTypeV1 = "https://github.com/slsa-framework/slsa-github-generator/generic@v1"

	// ContainerGeneratorBuildTypeV1 is the buildType for the container generator.
	ContainerGeneratorBuildTypeV1 = "https://github.com/slsa-framework/slsa-github-generator/container@v1"

	// NpmCLIBuildTypeV1 is the buildType for provenance generated by the npm cli.
	NpmCLIBuildTypeV1 = "https://github.com/npm/cli/gha@v1"

	// NpmCLIBuildTypeV2 is the buildType for provenance generated by the npm cli.
	NpmCLIBuildTypeV2 = "https://github.com/npm/cli/gha/v2"
)
View Source
var (
	// LegacyGoBuilderBuildTypeV1 is a legacy Go builder buildType.
	LegacyGoBuilderBuildTypeV1 = "https://github.com/slsa-framework/slsa-github-generator-go@v1"

	// LegacyBuilderBuildTypeV1 is a legacy generic build type for slsa-github-generator.
	LegacyBuilderBuildTypeV1 = "https://github.com/slsa-framework/slsa-github-generator@v1"
)

Legacy buildTypes.

Functions

func Exists

func Exists(environment map[string]any, field string) bool

Exists returns true if the given key exists in the environment.

func GetAsString

func GetAsString(environment map[string]any, field string) (string, error)

GetAsString returns the value in the given environment as a string.

func GetBranch

func GetBranch(environment map[string]any, upperEnv bool) (string, error)

GetBranch returns the triggering event's branch based on the given environment.

func GetEventPayload

func GetEventPayload(environment map[string]any, upperEnv bool) (map[string]any, error)

GetEventPayload retrieves the GitHub event payload from the environment map that contains the GitHub context payload.

func GetTag

func GetTag(environment map[string]any, upperEnv bool) (string, error)

GetTag returns the triggering event's tag based on the given environment.

func GetWorkflowInputs

func GetWorkflowInputs(environment map[string]any, upperEnv bool) (map[string]any, error)

GetWorkflowInputs gets the workflow inputs from the GitHub environment map and converts the keys to the necessary casing depending on predicate type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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