Skip to content

Commit

Permalink
Merge pull request #24 from mozilla-services/fix-for-github-actions
Browse files Browse the repository at this point in the history
Check for both .yml and .yaml configs πŸ›
  • Loading branch information
hackebrot authored Nov 15, 2024
2 parents a5267c3 + 475e7bc commit 3fbf36d
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 3fbf36d

Please sign in to comment.