Skip to content

Commit 76fbc1f

Browse files
authoredOct 29, 2024··
fix(ci): ignore temporary files when checking for out of bound symlinks (#20527)
Signed-off-by: cef <moncef.abboud95@gmail.com>
1 parent 3625689 commit 76fbc1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎util/app/path/path.go

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package path
22

33
import (
4+
"errors"
45
"fmt"
56
"os"
67
"path/filepath"
@@ -51,6 +52,11 @@ func CheckOutOfBoundsSymlinks(basePath string) error {
5152
}
5253
return filepath.Walk(absBasePath, func(path string, info os.FileInfo, err error) error {
5354
if err != nil {
55+
// Ignore "no such file or directory" errors than can happen with
56+
// temporary files such as .git/*.lock
57+
if errors.Is(err, os.ErrNotExist) {
58+
return nil
59+
}
5460
return fmt.Errorf("failed to walk for symlinks in %s: %w", absBasePath, err)
5561
}
5662
if files.IsSymlink(info) {

0 commit comments

Comments
 (0)
Please sign in to comment.