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
+5
View File
@@ -100,6 +100,11 @@ func UpdateVariable(ctx context.Context, variable *ActionVariable) (bool, error)
func GetVariablesOfRun(ctx context.Context, run *ActionRun) (map[string]string, error) {
variables := map[string]string{}
if err := run.LoadRepo(ctx); err != nil {
log.Error("LoadRepo: %v", err)
return nil, err
}
// Org / User level
ownerVariables, err := FindVariables(ctx, FindVariablesOpts{OwnerID: run.Repo.OwnerID})
if err != nil {