Read localaction's from container (#719)

Fix localaction tests (missing checkout)

Co-authored-by: Ryan (hackercat) <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2021-08-03 17:39:56 +00:00
1 parent 531ea02fb9
commit 0ff204b615
6 files changed
+65 -16

No files matched your search

+7 -2
View File
@@ -20,6 +20,7 @@ import (
// NewDockerBuildExecutorInput the input for the NewDockerBuildExecutor function
type NewDockerBuildExecutorInput struct {
ContextDir string
Container Container
ImageTag string
Platform string
}
@@ -46,8 +47,12 @@ func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor {
Remove: true,
Platform: input.Platform,
}
buildContext, err := createBuildContext(input.ContextDir, "Dockerfile")
var buildContext io.ReadCloser
if input.Container != nil {
buildContext, err = input.Container.GetContainerArchive(ctx, input.ContextDir+"/.")
} else {
buildContext, err = createBuildContext(input.ContextDir, "Dockerfile")
}
if err != nil {
return err
}