loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add vars context to cron jobs (#3059)

Introduce vars context into cron triggered actions

Fixes #3044

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3059
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>

authored by

TheFox0x7
TheFox0x7
and committed by
Earl Warren
5f051969 d9f6c595

+10 -1
+10 -1
services/actions/schedule_tasks.go
··· 127 127 Status: actions_model.StatusWaiting, 128 128 } 129 129 130 + if err := run.LoadAttributes(ctx); err != nil { 131 + log.Error("LoadAttributes: %v", err) 132 + } 133 + 134 + vars, err := actions_model.GetVariablesOfRun(ctx, run) 135 + if err != nil { 136 + log.Error("GetVariablesOfSchedule: %v", err) 137 + } 138 + 130 139 // Parse the workflow specification from the cron schedule 131 - workflows, err := jobparser.Parse(cron.Content) 140 + workflows, err := jobparser.Parse(cron.Content, jobparser.WithVars(vars)) 132 141 if err != nil { 133 142 return err 134 143 }