From dc4f77bdcb1cbfb108a98ca7c18c5d9cf4d5a01a Mon Sep 17 00:00:00 2001 From: Yuriy Losev Date: Wed, 25 Oct 2023 23:03:33 +0400 Subject: [PATCH] Ignore some files extensions (#544) --- pkg/utils/file/file.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/utils/file/file.go b/pkg/utils/file/file.go index 92e063b1..2a6c8dcc 100644 --- a/pkg/utils/file/file.go +++ b/pkg/utils/file/file.go @@ -47,6 +47,12 @@ func RecursiveGetExecutablePaths(dir string) ([]string, error) { return nil } + // ignore .yaml, .json, .txt, .md files + switch filepath.Ext(f.Name()) { + case ".yaml", ".json", ".md", ".txt": + return nil + } + if !IsFileExecutable(f) { log.Warnf("File '%s' is skipped: no executable permissions, chmod +x is required to run this hook", path) return nil