Skip to content

Commit

Permalink
fix(ci): ignore temporary files when checking for out of bound symlin…
Browse files Browse the repository at this point in the history
…ks (argoproj#20527)

Signed-off-by: cef <[email protected]>
  • Loading branch information
CefBoud authored and pasha-codefresh committed Nov 8, 2024
1 parent 2dd0c3e commit 449c53e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util/app/path/path.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package path

import (
"errors"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -51,6 +52,11 @@ func CheckOutOfBoundsSymlinks(basePath string) error {
}
return filepath.Walk(absBasePath, func(path string, info os.FileInfo, err error) error {
if err != nil {
// Ignore "no such file or directory" errors than can happen with
// temporary files such as .git/*.lock
if errors.Is(err, os.ErrNotExist) {
return nil
}
return fmt.Errorf("failed to walk for symlinks in %s: %w", absBasePath, err)
}
if files.IsSymlink(info) {
Expand Down

0 comments on commit 449c53e

Please sign in to comment.