]> source.dussan.org Git - gitea.git/commitdiff
Fix ambiguous id when fetch Actions tasks (#30382)
authorJason Song <i@wolfogre.com>
Wed, 10 Apr 2024 02:57:43 +0000 (10:57 +0800)
committerGitHub <noreply@github.com>
Wed, 10 Apr 2024 02:57:43 +0000 (02:57 +0000)
Fix regression of #30331.

```txt
time="2024-04-10T02:23:49Z" level=error msg="failed to fetch task" func="[fetchTask]" file="[poller.go:91]" error="unknown: rpc error: code = Internal desc = pick task: CreateTaskForRunner: Error 1052 (23000): Column 'id' in field list is ambiguous"
```

models/actions/task.go

index 1e279659c775167eafe92e6e136f6a41cd4c585e..9946cf5233c7212a59a78d6d5ba2fc608ac3ecc8 100644 (file)
@@ -228,7 +228,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
        if runner.RepoID != 0 {
                jobCond = builder.Eq{"repo_id": runner.RepoID}
        } else if runner.OwnerID != 0 {
-               jobCond = builder.In("repo_id", builder.Select("id").From("repository").
+               jobCond = builder.In("repo_id", builder.Select("`repository`.id").From("repository").
                        Join("INNER", "repo_unit", "`repository`.id = `repo_unit`.repo_id").
                        Where(builder.Eq{"`repository`.owner_id": runner.OwnerID, "`repo_unit`.type": unit.TypeActions}))
        }