Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigFileNotFound = fmt.Errorf("config file not found")
Functions ¶
This section is empty.
Types ¶
type ActionArmorConfigFile ¶
type ActionArmorConfigFile struct {
// contains filtered or unexported fields
}
func GetConfigFile ¶
func GetConfigFile(proj *actionlint.Project) (*ActionArmorConfigFile, error)
func NewConfigFileFromFS ¶
func NewConfigFileFromFS(fs fs.FS) *ActionArmorConfigFile
func NewConfigFileFromFile ¶
func NewConfigFileFromFile(path string) *ActionArmorConfigFile
func (ActionArmorConfigFile) DirPath ¶
func (c ActionArmorConfigFile) DirPath() string
func (ActionArmorConfigFile) FileName ¶
func (c ActionArmorConfigFile) FileName() string
func (ActionArmorConfigFile) FilePath ¶
func (c ActionArmorConfigFile) FilePath() string
func (ActionArmorConfigFile) Hash ¶
func (c ActionArmorConfigFile) Hash() string
Hash returns a hash value of the instance. Note that the hash value is calculated based on the file path and the source of the instance and it is not a hash of the file content.
func (ActionArmorConfigFile) ReadFile ¶
func (c ActionArmorConfigFile) ReadFile() ([]byte, error)
type ConfigSource ¶
type ConfigSource string
const ( ConfigSourceFile ConfigSource = "file" ConfigSourceFS ConfigSource = "fs" )
type WorkflowInfo ¶
type WorkflowInfo struct { // FilePath is an absolute path to the GitHub Actions workflow file. FilePath string // Project is a GitHub project that contains the workflow file. Project *actionlint.Project // Config is an ActionArmor configuration file. Config *ActionArmorConfigFile }
func ListWorkflows ¶
func ListWorkflows(paths []string, logger *slog.Logger) ([]*WorkflowInfo, error)
ListWorkflows returns a list of WorkflowInfo from the given paths.
The first argument 'paths' can be a list of file paths or directories. If a path is a file, it is treated as a workflow file. If a path is a directory, it searches workflow files in the repository.
Click to show internal directories.
Click to hide internal directories.