update to latest version of action parser

This commit is contained in:
Casey Lee
2019-01-31 16:36:28 -08:00
parent bc5c23e8e4
commit 3e04312912
10 changed files with 89 additions and 46 deletions

View File

@@ -1,7 +1,6 @@
package actions
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
@@ -60,12 +59,14 @@ func (runner *runnerImpl) setupWorkflows() error {
defer workflowReader.Close()
runner.workflowConfig, err = parser.Parse(workflowReader)
if err != nil {
parserError := err.(*parser.ParserError)
for _, e := range parserError.Errors {
fmt.Fprintln(os.Stderr, e)
/*
if err != nil {
parserError := err.(*parser.ParserError)
for _, e := range parserError.Errors {
fmt.Fprintln(os.Stderr, e)
}
}
}
*/
return err
}

View File

@@ -95,10 +95,18 @@ func (runner *runnerImpl) newActionExecutor(actionName string) common.Executor {
for k, v := range env {
envList = append(envList, fmt.Sprintf("%s=%s", k, v))
}
var cmd, entrypoint []string
if action.Args != nil {
cmd = action.Args.Split()
}
if action.Runs != nil {
entrypoint = action.Runs.Split()
}
executors = append(executors, container.NewDockerRunExecutor(container.NewDockerRunExecutorInput{
DockerExecutorInput: in,
Cmd: action.Args.Parsed,
Entrypoint: action.Runs.Parsed,
Cmd: cmd,
Entrypoint: entrypoint,
Image: image,
WorkingDir: "/github/workspace",
Env: envList,