Skip to content

Commit

Permalink
Ignore runs-on with expressions when warning no matched runners (#2…
Browse files Browse the repository at this point in the history
…5917) (#25933)

Backport #25917 by @wolfogre

Fix #25905

Co-authored-by: Jason Song <i@wolfogre.com>
  • Loading branch information
GiteaBot and wolfogre authored Jul 18, 2023
1 parent d032500 commit b7d054e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions routers/web/repo/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package actions
import (
"bytes"
"net/http"
"strings"

actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
Expand Down Expand Up @@ -105,6 +106,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
Expand Down

0 comments on commit b7d054e

Please sign in to comment.