mirror of
https://github.com/go-gitea/gitea
synced 2025-07-25 19:58:36 +00:00
chore: new way to trim entries
This commit is contained in:
@@ -32,16 +32,13 @@ func ListWorkflows(commit *git.Commit) (git.Entries, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
idx := 0
|
||||
ret := make(git.Entries, 0, len(entries))
|
||||
for _, entry := range entries {
|
||||
if !strings.HasSuffix(entry.Name(), ".yml") && !strings.HasSuffix(entry.Name(), ".yaml") {
|
||||
continue
|
||||
if strings.HasSuffix(entry.Name(), ".yml") || strings.HasSuffix(entry.Name(), ".yaml") {
|
||||
ret = append(ret, entry)
|
||||
}
|
||||
entries[idx] = entry
|
||||
idx++
|
||||
}
|
||||
|
||||
return entries[:idx], nil
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func DetectWorkflows(commit *git.Commit, event webhook.HookEventType) (map[string][]byte, error) {
|
||||
|
Reference in New Issue
Block a user