feat(healthcheck): log error on .gitignore error
Some checks failed
submodules sync / sync (push) Successful in 50s
build / build (push) Failing after 39s
build / trigger-build-image (push) Has been skipped

This commit is contained in:
张泊明518370910136 2024-11-27 03:59:10 -05:00
parent 7d9cd723f0
commit 38f11788a0
GPG Key ID: D47306D7062CDA9D

View File

@ -16,9 +16,13 @@ func getForbiddens(root string) ([]string, error) {
var matches []string var matches []string
// Create a gitignore instance from the .gitignore file // Create a gitignore instance from the .gitignore file
ignore := gitignore.NewRepositoryWithCache(root, ".gitignore", gitignore.NewCache(), func(e gitignore.Error) bool { ignore := gitignore.NewRepositoryWithCache(
return false root, ".gitignore", gitignore.NewCache(),
}) func(e gitignore.Error) bool {
slog.Error("gitignore error", "error", e)
return true
},
)
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil { if err != nil {