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