@@ -70,7 +70,7 @@ func PrepareConcurrencyForRunAndJobs(ctx context.Context, wfContent []byte, run
70
70
// because it will be checked by job emitter
71
71
if runJob .Status != actions_model .StatusBlocked && len (needs ) == 0 {
72
72
var err error
73
- runJob .ConcurrencyGroup , runJob .ConcurrencyCancel , err = evaluateJobConcurrency (ctx , runJob , vars , map [string ]* jobparser.JobResult {})
73
+ runJob .ConcurrencyGroup , runJob .ConcurrencyCancel , err = evaluateJobConcurrency (run , runJob , vars , map [string ]* jobparser.JobResult {})
74
74
if err != nil {
75
75
return nil , fmt .Errorf ("evaluate job concurrency: %w" , err )
76
76
}
@@ -83,12 +83,7 @@ func PrepareConcurrencyForRunAndJobs(ctx context.Context, wfContent []byte, run
83
83
return runJobs , nil
84
84
}
85
85
86
- func evaluateJobConcurrency (ctx context.Context , actionRunJob * actions_model.ActionRunJob , vars map [string ]string , jobResults map [string ]* jobparser.JobResult ) (string , bool , error ) {
87
- if err := actionRunJob .LoadRun (ctx ); err != nil {
88
- return "" , false , err
89
- }
90
- run := actionRunJob .Run
91
-
86
+ func evaluateJobConcurrency (run * actions_model.ActionRun , actionRunJob * actions_model.ActionRunJob , vars map [string ]string , jobResults map [string ]* jobparser.JobResult ) (string , bool , error ) {
92
87
rawConcurrency := & act_model.RawConcurrency {
93
88
Group : actionRunJob .RawConcurrencyGroup ,
94
89
CancelInProgress : actionRunJob .RawConcurrencyCancel ,
@@ -102,7 +97,11 @@ func evaluateJobConcurrency(ctx context.Context, actionRunJob *actions_model.Act
102
97
}
103
98
actJob := actWorkflow .GetJob (actionRunJob .JobID )
104
99
105
- concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actJob , gitCtx , vars , jobResults )
100
+ if len (jobResults ) == 0 {
101
+ jobResults = map [string ]* jobparser.JobResult {actionRunJob .JobID : {}}
102
+ }
103
+
104
+ concurrencyGroup , concurrencyCancel := jobparser .EvaluateJobConcurrency (rawConcurrency , actionRunJob .JobID , actJob , gitCtx , vars , jobResults )
106
105
107
106
return concurrencyGroup , concurrencyCancel , nil
108
107
}
0 commit comments