Skip to content

Commit 577ff3f

Browse files
committed
migrate some improvements discussed in review
1 parent 5f0b304 commit 577ff3f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

services/actions/workflow.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,19 @@ func DispatchActionWorkflow(ctx *context.Context, workflowID, ref string, proces
209209
// find workflow from commit
210210
var workflows []*jobparser.SingleWorkflow
211211
for _, entry := range entries {
212-
if entry.Name() == workflowID {
213-
content, err := actions.GetContentFromEntry(entry)
214-
if err != nil {
215-
return err
216-
}
217-
workflows, err = jobparser.Parse(content)
218-
if err != nil {
219-
return err
220-
}
221-
break
212+
if entry.Name() != workflowID {
213+
continue
222214
}
215+
216+
content, err := actions.GetContentFromEntry(entry)
217+
if err != nil {
218+
return err
219+
}
220+
workflows, err = jobparser.Parse(content)
221+
if err != nil {
222+
return err
223+
}
224+
break
223225
}
224226

225227
if len(workflows) == 0 {

0 commit comments

Comments
 (0)