4
4
package actions
5
5
6
6
import (
7
- "bytes"
8
7
"fmt"
9
8
10
9
actions_model "code.gitea.io/gitea/models/actions"
@@ -28,26 +27,14 @@ func evaluateJobConcurrency(run *actions_model.ActionRun, actionRunJob *actions_
28
27
return "" , false , fmt .Errorf ("not single workflow" )
29
28
}
30
29
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
-
45
30
if jobResults == nil {
46
31
jobResults = map [string ]* jobparser.JobResult {}
47
32
}
48
- jobResults [actionRunJob .JobID ] = & jobparser.JobResult {}
33
+ jobResults [actionRunJob .JobID ] = & jobparser.JobResult {
34
+ Needs : actionRunJob .Needs ,
35
+ }
49
36
50
- concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actionRunJob .JobID , actJob , gitCtx , vars , jobResults )
37
+ concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actionRunJob .JobID , gitCtx , vars , jobResults )
51
38
52
39
return concurrencyGroup , concurrencyCancel , nil
53
40
}
0 commit comments