44package actions
55
66import (
7- "bytes"
87 "fmt"
98
109 actions_model "code.gitea.io/gitea/models/actions"
@@ -28,26 +27,14 @@ func evaluateJobConcurrency(run *actions_model.ActionRun, actionRunJob *actions_
2827 return "" , false , fmt .Errorf ("not single workflow" )
2928 }
3029
31- // FIXME: cannot get job needs
32- singleWorkflow := singleWorkflows [0 ]
33- singleWorkflow .Job ()
34- actJobMap := map [string ]* act_model.Job {}
35- if err := singleWorkflow .RawJobs .Decode (& actJobMap ); err != nil {
36- return "" , false , fmt .Errorf ("decode act job: %w" , err )
37- }
38-
39- actWorkflow , err := act_model .ReadWorkflow (bytes .NewReader (actionRunJob .WorkflowPayload ))
40- if err != nil {
41- return "" , false , fmt .Errorf ("read workflow: %w" , err )
42- }
43- actJob := actWorkflow .GetJob (actionRunJob .JobID )
44-
4530 if jobResults == nil {
4631 jobResults = map [string ]* jobparser.JobResult {}
4732 }
48- jobResults [actionRunJob .JobID ] = & jobparser.JobResult {}
33+ jobResults [actionRunJob .JobID ] = & jobparser.JobResult {
34+ Needs : actionRunJob .Needs ,
35+ }
4936
50- concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actionRunJob .JobID , actJob , gitCtx , vars , jobResults )
37+ concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actionRunJob .JobID , gitCtx , vars , jobResults )
5138
5239 return concurrencyGroup , concurrencyCancel , nil
5340}
0 commit comments