aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorsillyguodong <33891828+sillyguodong@users.noreply.github.com>2024-03-08 14:14:35 +0800
committerGitHub <noreply@github.com>2024-03-08 06:14:35 +0000
commita1f5dd767729e30d07ab42fda80c19f30a72679f (patch)
tree1b6fb1601940d7984607a67f2be7abe21ff889d6 /services
parentc8f4897f7f5de5b391be806f4738de1f0d9c4c09 (diff)
downloadgitea-a1f5dd767729e30d07ab42fda80c19f30a72679f.tar.gz
gitea-a1f5dd767729e30d07ab42fda80c19f30a72679f.zip
Make runs-on support variable expression (#29468)
As title. Close issue: https://gitea.com/gitea/act_runner/issues/445 Follow: https://gitea.com/gitea/act/pulls/91 Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because of circular dependency issues.
Diffstat (limited to 'services')
-rw-r--r--services/actions/notifier_helper.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go
index b0d848b5ad..d84191dca2 100644
--- a/services/actions/notifier_helper.go
+++ b/services/actions/notifier_helper.go
@@ -296,7 +296,18 @@ func handleWorkflows(
run.NeedApproval = need
}
- jobs, err := jobparser.Parse(dwf.Content)
+ if err := run.LoadAttributes(ctx); err != nil {
+ log.Error("LoadAttributes: %v", err)
+ continue
+ }
+
+ vars, err := actions_model.GetVariablesOfRun(ctx, run)
+ if err != nil {
+ log.Error("GetVariablesOfRun: %v", err)
+ continue
+ }
+
+ jobs, err := jobparser.Parse(dwf.Content, jobparser.WithVars(vars))
if err != nil {
log.Error("jobparser.Parse: %v", err)
continue