Interpolate runs-on with variables when scheduling tasks(#30640) (#30672)

backport: #30640

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
sillyguodong
2024-04-24 22:37:05 +02:00
committed by GitHub
co-authored by Giteabot
parent ddf64b84e4
commit 7aa8b8e2d2
3 changed files with 28 additions and 7 deletions
+7 -1
View File
@@ -127,8 +127,14 @@ func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule)
Status: actions_model.StatusWaiting,
}
vars, err := actions_model.GetVariablesOfRun(ctx, run)
if err != nil {
log.Error("GetVariablesOfRun: %v", err)
return err
}
// Parse the workflow specification from the cron schedule
workflows, err := jobparser.Parse(cron.Content)
workflows, err := jobparser.Parse(cron.Content, jobparser.WithVars(vars))
if err != nil {
return err
}