repositoryconfig

package
v1.116.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package repositoryconfig reads the Chainloop configuration committed to a repository.

Index

Constants

This section is empty.

Variables

View Source
var ErrChainloopYMLNotFound = errors.New(".chainloop.yml not found")

ErrChainloopYMLNotFound indicates that neither supported config filename exists.

Functions

func LoadProjectFromYML

func LoadProjectFromYML(dir string) string

LoadProjectFromYML returns projectName from the nearest repository config.

Types

type ChainloopYML

type ChainloopYML struct {
	ProjectName    string `yaml:"projectName"`
	ProjectVersion string `yaml:"projectVersion"`
	Organization   string `yaml:"organization,omitempty"`
	RequireTrace   *bool  `yaml:"requireTrace,omitempty"`
	WorkflowName   string `yaml:"workflowName,omitempty"`
}

ChainloopYML represents the relevant fields in .chainloop.yml.

func FindChainloopYML

func FindChainloopYML(dir string) *ChainloopYML

FindChainloopYML returns the nearest repository config, or nil when it cannot be loaded. Call LoadChainloopYML when the path or error is needed.

func LoadChainloopYML

func LoadChainloopYML(dir string) (*ChainloopYML, string, error)

LoadChainloopYML loads the nearest .chainloop.yml (or .chainloop.yaml), walking from dir to the git repository root. In each directory, .yml takes precedence over .yaml. A config without projectName is still valid.

Jump to

Keyboard shortcuts

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