loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Avoid running action when action unit is disabled after workflows detected (#30331)

Fix #30243

We only checking unit disabled when detecting workflows, but not in
runner `FetchTask`.
So if a workflow was detected when action unit is enabled, but disabled
later, `FetchTask` will still return these detected actions.

Global setting: repo.ENABLED and repository.`DISABLED_REPO_UNITS` will
not effect this.

(cherry picked from commit d872ce006c0400edb10a05f7555f9b08070442e3)

authored by

yp05327 and committed by
Gergely Nagy
84abf4bd 84207afa

+4 -1
+4 -1
models/actions/task.go
··· 11 11 12 12 auth_model "code.gitea.io/gitea/models/auth" 13 13 "code.gitea.io/gitea/models/db" 14 + "code.gitea.io/gitea/models/unit" 14 15 "code.gitea.io/gitea/modules/container" 15 16 "code.gitea.io/gitea/modules/log" 16 17 "code.gitea.io/gitea/modules/setting" ··· 227 228 if runner.RepoID != 0 { 228 229 jobCond = builder.Eq{"repo_id": runner.RepoID} 229 230 } else if runner.OwnerID != 0 { 230 - jobCond = builder.In("repo_id", builder.Select("id").From("repository").Where(builder.Eq{"owner_id": runner.OwnerID})) 231 + jobCond = builder.In("repo_id", builder.Select("id").From("repository"). 232 + Join("INNER", "repo_unit", "`repository`.id = `repo_unit`.repo_id"). 233 + Where(builder.Eq{"`repository`.owner_id": runner.OwnerID, "`repo_unit`.type": unit.TypeActions})) 231 234 } 232 235 if jobCond.IsValid() { 233 236 jobCond = builder.In("run_id", builder.Select("id").From("action_run").Where(jobCond))