fix(healthcheck): ignore with space
Some checks failed
build / build (push) Failing after 43s
build / trigger-build-image (push) Has been skipped

This commit is contained in:
Hydraallen 2024-11-27 20:10:03 +08:00
parent 38f11788a0
commit ca2b40805f

View File

@ -47,6 +47,11 @@ func getForbiddens(root string) ([]string, error) {
} }
match := ignore.Relative(relPath, true) match := ignore.Relative(relPath, true)
// Trim trailing spaces from the match pattern
if match != nil && strings.TrimSpace(match.Pattern()) != match.Pattern() {
match = gitignore.NewMatch(strings.TrimSpace(match.Pattern()))
}
// Check if the relative file path should be ignored based on the .gitignore rules // Check if the relative file path should be ignored based on the .gitignore rules
if match != nil && match.Ignore() { if match != nil && match.Ignore() {
matches = append(matches, path) matches = append(matches, path)