summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorearl-warren <earl-warren@noreply.code.forgejo.org>2024-12-28 09:02:23 +0100
committerearl-warren <earl-warren@noreply.code.forgejo.org>2024-12-28 09:02:23 +0100
commit2c34d981940a6d66b97e8553e1d2f8ea5d513117 (patch)
tree3681a032715cf5ce54b1bdbdae8420d74e77b36c
parentMerge pull request 'chore(tests): add ./pkg/container tests' (#86) from earl-... (diff)
parentfix: Do not fail on nil error (diff)
downloadforgejo-act-2c34d981940a6d66b97e8553e1d2f8ea5d513117.tar.xz
forgejo-act-2c34d981940a6d66b97e8553e1d2f8ea5d513117.zip
Merge pull request 'fix: Do not fail on nil error' (#87) from vpotyarkin/act:fix/nil-error into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/87 Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
-rw-r--r--pkg/container/docker_run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/container/docker_run.go b/pkg/container/docker_run.go
index 191b424..3232c14 100644
--- a/pkg/container/docker_run.go
+++ b/pkg/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)