mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-31 18:30:58 +00:00
update to latest version of action parser
This commit is contained in:
parent
4e66f2c8be
commit
9c3a288946
8 changed files with 84 additions and 43 deletions
38
vendor/github.com/actions/workflow-parser/model/command.go
generated
vendored
Normal file
38
vendor/github.com/actions/workflow-parser/model/command.go
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Command represents the optional "runs" and "args" attributes.
|
||||
// Each one takes one of two forms:
|
||||
// - runs="entrypoint arg1 arg2 ..."
|
||||
// - runs=[ "entrypoint", "arg1", "arg2", ... ]
|
||||
type Command interface {
|
||||
isCommand()
|
||||
Split() []string
|
||||
}
|
||||
|
||||
// StringCommand represents the string based form of the "runs" or "args"
|
||||
// attribute.
|
||||
// - runs="entrypoint arg1 arg2 ..."
|
||||
type StringCommand struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// ListCommand represents the list based form of the "runs" or "args" attribute.
|
||||
// - runs=[ "entrypoint", "arg1", "arg2", ... ]
|
||||
type ListCommand struct {
|
||||
Values []string
|
||||
}
|
||||
|
||||
func (s *StringCommand) isCommand() {}
|
||||
func (l *ListCommand) isCommand() {}
|
||||
|
||||
func (s *StringCommand) Split() []string {
|
||||
return strings.Fields(s.Value)
|
||||
}
|
||||
|
||||
func (l *ListCommand) Split() []string {
|
||||
return l.Values
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue