From 324188e23938bdaae532923402e70409d429d58a Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Fri, 27 Dec 2024 17:56:23 +0300 Subject: [PATCH] fix: Do not fail on nil error Commit 5a351d33df5a3ffc3ac8523593a440e4843c341b has introduced a regression due to which copyDir() would fail after closing the archive successfully Signed-off-by: Vitaliy Potyarkin --- act/container/docker_run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/act/container/docker_run.go b/act/container/docker_run.go index 191b424f..3232c140 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -753,7 +753,7 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno defer func(tarFile *os.File) { name := tarFile.Name() err := tarFile.Close() - if !errors.Is(err, os.ErrClosed) { + if err != nil && !errors.Is(err, os.ErrClosed) { logger.Error(err) } err = os.Remove(name)