diff --git a/sdk-internals/communicator/ssh/communicator.go b/sdk-internals/communicator/ssh/communicator.go index 3892bb1e6..de4f31bea 100644 --- a/sdk-internals/communicator/ssh/communicator.go +++ b/sdk-internals/communicator/ssh/communicator.go @@ -539,6 +539,15 @@ func (c *comm) sftpUploadDirSession(dst string, src string, excl []string) error if err != nil { return err } + + // If the path is excluded, skip it + for _, v := range excl { + if v == relSrc { + log.Printf("[DEBUG] Skipping excluded path: %s", relSrc) + return nil + } + } + finalDst := filepath.Join(rootDst, relSrc) // In Windows, Join uses backslashes which we don't want to get