diff --git a/kaniko.go b/kaniko.go index 678fd51..4eb0448 100644 --- a/kaniko.go +++ b/kaniko.go @@ -483,14 +483,13 @@ func (p Plugin) Exec() error { } } - if p.Output.OutputFile != "" { - var tarPath string - if p.Build.TarPath != "" { - tarPath = getTarPath(p.Build.TarPath) - } - if err = output.WritePluginOutputFile(p.Output.OutputFile, getDigest(p.Build.DigestFile), tarPath); err != nil { - fmt.Fprintf(os.Stderr, "failed to write plugin output file at path: %s with error: %s\n", p.Output.OutputFile, err) - } + p.Output.OutputFile = os.Getenv("DRONE_OUTPUT") + var tarPath string + if p.Build.TarPath != "" { + tarPath = getTarPath(p.Build.TarPath) + } + if err = output.WritePluginOutputFile(p.Output.OutputFile, getDigest(p.Build.DigestFile), tarPath); err != nil { + fmt.Fprintf(os.Stderr, "failed to write plugin output file at path: %s with error: %s\n", p.Output.OutputFile, err) } return nil