Skip to content

Commit e3d9b6f

Browse files
authored
Merge pull request #69 from cultureamp/exit
fix: return error on non-zero condition for task
2 parents 4960fdc + 976c06a commit e3d9b6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugin/task-runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (trp TaskRunnerPlugin) Run(ctx context.Context, fetcher ConfigFetcher, wait
107107

108108
// TODO: Assuming the task only has 1 container. What if there others? Like Datadog sidecar
109109
if *task.Containers[0].ExitCode != 0 {
110-
buildkite.LogFailuref("Task stopped with a non-zero exit code:: %d\n", *task.Containers[0].ExitCode)
110+
return fmt.Errorf("task stopped with a non-zero exit code: %d", *task.Containers[0].ExitCode)
111111
// TODO: At about here, a structured return type of "success: true/false" and "error" is returned
112112
} else {
113113
buildkite.Log("Task completed successfully :) \n")

0 commit comments

Comments
 (0)