aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2023-07-18 00:19:53 +0800
committerGitHub <noreply@github.com>2023-07-17 18:19:53 +0200
commit29e959fd009cc05fee8182929c1ee4a92a73f2a0 (patch)
treeb7745ad1b6f54b8ce3b1055c2cbaa255bc7634a9 /routers
parentff9a7afe99201eea052f66d308af97b25859ae8b (diff)
downloadgitea-29e959fd009cc05fee8182929c1ee4a92a73f2a0.tar.gz
gitea-29e959fd009cc05fee8182929c1ee4a92a73f2a0.zip
Ignore `runs-on` with expressions when warning no matched runners (#25917)
Fix #25905 Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/actions/actions.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go
index e1e07b5a72..d215201bcd 100644
--- a/routers/web/repo/actions/actions.go
+++ b/routers/web/repo/actions/actions.go
@@ -7,6 +7,7 @@ import (
"bytes"
"fmt"
"net/http"
+ "strings"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
@@ -106,6 +107,12 @@ func List(ctx *context.Context) {
for _, j := range wf.Jobs {
runsOnList := j.RunsOn()
for _, ro := range runsOnList {
+ if strings.Contains(ro, "${{") {
+ // Skip if it contains expressions.
+ // The expressions could be very complex and could not be evaluated here,
+ // so just skip it, it's OK since it's just a tooltip message.
+ continue
+ }
if !allRunnerLabels.Contains(ro) {
workflow.ErrMsg = ctx.Locale.Tr("actions.runs.no_matching_runner_helper", ro)
break