Skip to content

Commit

Permalink
fix: Check for both .yml and .yaml configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hackebrot committed Nov 15, 2024
1 parent a5267c3 commit 475e7bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ciplatforms/internal/github/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,14 @@ func updateRepos(batch []*Repository, data map[string]interface{}) error {
return nil
}

// hasYmlFile checks if any entry in the entries slice is a YAML file.
// hasYmlFile checks if any entry in the entries slice is a YAML file with a .yml or .yaml extension.
func hasYmlFile(entries []interface{}) bool {
for _, entry := range entries {
if entryMap, ok := entry.(map[string]interface{}); ok {
if name, ok := entryMap["name"].(string); ok && strings.HasSuffix(name, ".yml") {
return true
if name, ok := entryMap["name"].(string); ok {
if strings.HasSuffix(name, ".yml") || strings.HasSuffix(name, ".yaml") {
return true
}
}
}
}
Expand Down

0 comments on commit 475e7bc

Please sign in to comment.