Skip to content

Commit

Permalink
chore: add support for passing commands via a file (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-leonhard authored Oct 24, 2024
1 parent dc927a6 commit 43270d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 43270d5

Please sign in to comment.