diff --git a/main.go b/main.go index 7cc7fd1..7f0ec26 100644 --- a/main.go +++ b/main.go @@ -131,6 +131,11 @@ func main() { Usage: "execute single commands for github action", EnvVars: []string{"INPUT_SCRIPT"}, }, + &cli.StringFlag{ + Name: "script.file", + Usage: "execute commands from a file for github action", + EnvVars: []string{"INPUT_SCRIPT_FILE"}, + }, &cli.BoolFlag{ Name: "script.stop", Usage: "stop script after first failure", @@ -271,6 +276,14 @@ func run(c *cli.Context) error { scripts = append(scripts, s) } + if f := c.String("script.file"); f != "" { + s, err := os.ReadFile(f) + if err != nil { + return err + } + scripts = append(scripts, string(s)) + } + plugin := Plugin{ Config: Config{ Key: c.String("ssh-key"),