1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-31 06:38:37 +00:00

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-25 04:37:05 +08:00
committed by GitHub
parent ddf64b84e4
commit 7aa8b8e2d2
3 changed files with 28 additions and 7 deletions

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
}