workflowfile

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workflowfile finds the files a workflow is written in and reads them, as one text, in the order they are given: a later file overrides what an earlier one wrote.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsYAML

func IsYAML(name string) bool

IsYAML reports whether name has a .yml or .yaml extension.

func Paths

func Paths(filePath string) ([]string, error)

Paths resolves filePath, paths separated by commas, into the YAML (.yml and .yaml) files it names. A path is a file, a directory, whose YAML files are taken, or a glob. A file named on its own that is not YAML is refused, and one a directory or a glob finds is left out, as is a directory named as a YAML file.

func Read

func Read(paths []string, readFile func(string) ([]byte, error)) (string, [][]byte, error)

Read reads the files at paths with readFile, and returns them as one text, and the content of each, in their order. A newline is put after a file that does not end in one, unless it is the last, so that its last line is not joined to the first of the next.

Types

type Redefinition

type Redefinition struct {
	File, Prev     string
	Line, PrevLine int
}

Redefinition is a file that writes jobs at the top after an earlier file did. The files are read as one text, so its jobs replace the earlier ones, which do not run.

func RedefinedJobs

func RedefinedJobs(files []string, data [][]byte) []Redefinition

RedefinedJobs returns each of files, whose contents are data, that writes jobs at the top after an earlier file did, with the one it replaces. Only jobs is told of: a file that replaces vars, say, is how a workflow is run in other environments.

func (Redefinition) Message

func (r Redefinition) Message() string

Message tells what the redefinition does, without where it is.

func (Redefinition) String

func (r Redefinition) String() string

String returns the redefinition as a warning on the line of File.

Jump to

Keyboard shortcuts

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