aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-12-19 01:06:19 +0900
committerGitHub <noreply@github.com>2023-12-18 16:06:19 +0000
commit4ea522fecfd8f2d6b51466cb9ab6772f4594bf2e (patch)
treec8e67bf4ea8b1bca4adb409664f054b9113710c8 /routers
parente02095c5b6e04f70ae6562f5aee169f7ee93cf7a (diff)
downloadgitea-4ea522fecfd8f2d6b51466cb9ab6772f4594bf2e.tar.gz
gitea-4ea522fecfd8f2d6b51466cb9ab6772f4594bf2e.zip
Only check online runner when detecting matching runners in workflows (#28286)
Mentioned: [#28277](https://github.com/go-gitea/gitea/issues/28277#issuecomment-1831325276) We should only check online runner when detecting matching runners in workflows, as if runner is not online, the workflow will not run. ![image](https://github.com/go-gitea/gitea/assets/18380374/11855e9d-7241-4b7a-b8d7-49dbb94ba1c5)
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/actions/actions.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go
index fd541647b7..fe528a483b 100644
--- a/routers/web/repo/actions/actions.go
+++ b/routers/web/repo/actions/actions.go
@@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/web/repo"
"code.gitea.io/gitea/services/convert"
@@ -77,6 +78,7 @@ func List(ctx *context.Context) {
// Get all runner labels
runners, err := db.Find[actions_model.ActionRunner](ctx, actions_model.FindRunnerOptions{
RepoID: ctx.Repo.Repository.ID,
+ IsOnline: util.OptionalBoolTrue,
WithAvailable: true,
})
if err != nil {
@@ -113,7 +115,7 @@ func List(ctx *context.Context) {
continue
}
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_online_runner_helper", ro)
break
}
}