Skip to content

Commit 29e959f

Browse files
wolfogreGiteaBot
andauthored
Ignore runs-on with expressions when warning no matched runners (#25917)
Fix #25905 Co-authored-by: Giteabot <[email protected]>
1 parent ff9a7af commit 29e959f

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
@@ -7,6 +7,7 @@ import (
77
"bytes"
88
"fmt"
99
"net/http"
10+
"strings"
1011

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

0 commit comments

Comments
 (0)