Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderUses ¶
RenderUses builds the replacement string for the matched span. If srcRef is empty, no trailing comment is emitted (and tail is dropped).
Types ¶
type File ¶
type File struct {
Path string
Lines []string
TrailingNewln bool // whether the original file ended with a newline
Mode os.FileMode
}
File is the contents of a workflow file, split into lines without their terminating newline (and with \r preserved for CRLF inputs).
func (*File) FindAllUses ¶
FindAllUses returns every `uses:` match across the file.
func (*File) HasWorkflowMarker ¶
HasWorkflowMarker reports whether any line begins with `on:` or `jobs:` at the start of the line (after optional whitespace). Mirrors legacy.
func (*File) ReplaceMatch ¶
ReplaceMatch swaps the substring at m's span in the corresponding line with `repl`. Safe to call for one match at a time; if you have multiple matches on the same line, apply right-to-left to keep offsets valid.
type UsesMatch ¶
type UsesMatch struct {
LineIndex int // 0-based
Start int // byte offset in line where match begins
End int // byte offset where match ends (exclusive)
Quote string // optional quote style around the uses value: ' or "
Action action.Ref // parsed action ref
}
UsesMatch is one `uses:` occurrence within a single line.