mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 00:11:04 +00:00 
			
		
		
		
	Ignore runs-on with expressions when warning no matched runners (#25917)
		
	Fix #25905 Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		
					parent
					
						
							
								ff9a7afe99
							
						
					
				
			
			
				commit
				
					
						29e959fd00
					
				
			
		
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -7,6 +7,7 @@ import (
 | 
				
			||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	actions_model "code.gitea.io/gitea/models/actions"
 | 
						actions_model "code.gitea.io/gitea/models/actions"
 | 
				
			||||||
	"code.gitea.io/gitea/models/db"
 | 
						"code.gitea.io/gitea/models/db"
 | 
				
			||||||
| 
						 | 
					@ -106,6 +107,12 @@ func List(ctx *context.Context) {
 | 
				
			||||||
			for _, j := range wf.Jobs {
 | 
								for _, j := range wf.Jobs {
 | 
				
			||||||
				runsOnList := j.RunsOn()
 | 
									runsOnList := j.RunsOn()
 | 
				
			||||||
				for _, ro := range runsOnList {
 | 
									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) {
 | 
										if !allRunnerLabels.Contains(ro) {
 | 
				
			||||||
						workflow.ErrMsg = ctx.Locale.Tr("actions.runs.no_matching_runner_helper", ro)
 | 
											workflow.ErrMsg = ctx.Locale.Tr("actions.runs.no_matching_runner_helper", ro)
 | 
				
			||||||
						break
 | 
											break
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue