Skip to content

Commit b7d054e

Browse files
GiteaBotwolfogre
andauthored
Ignore runs-on with expressions when warning no matched runners (#25917) (#25933)
Backport #25917 by @wolfogre Fix #25905 Co-authored-by: Jason Song <[email protected]>
1 parent d032500 commit b7d054e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

routers/web/repo/actions/actions.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package actions
66
import (
77
"bytes"
88
"net/http"
9+
"strings"
910

1011
actions_model "code.gitea.io/gitea/models/actions"
1112
"code.gitea.io/gitea/models/db"
@@ -105,6 +106,12 @@ func List(ctx *context.Context) {
105106
for _, j := range wf.Jobs {
106107
runsOnList := j.RunsOn()
107108
for _, ro := range runsOnList {
109+
if strings.Contains(ro, "${{") {
110+
// Skip if it contains expressions.
111+
// The expressions could be very complex and could not be evaluated here,
112+
// so just skip it, it's OK since it's just a tooltip message.
113+
continue
114+
}
108115
if !allRunnerLabels.Contains(ro) {
109116
workflow.ErrMsg = ctx.Locale.Tr("actions.runs.no_matching_runner_helper", ro)
110117
break

0 commit comments

Comments
 (0)