diff options
author | Jason Song <i@wolfogre.com> | 2024-04-10 10:57:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 02:57:43 +0000 |
commit | 310e2517e5d55a037f612a8561fb1850b517b37f (patch) | |
tree | 8755669740a3dbe6152c76f85cb52127ac0c47b6 /models | |
parent | fec754258cce7f82ce9263f2dd0fad3f0b078d8a (diff) | |
download | gitea-310e2517e5d55a037f612a8561fb1850b517b37f.tar.gz gitea-310e2517e5d55a037f612a8561fb1850b517b37f.zip |
Fix ambiguous id when fetch Actions tasks (#30382)
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"
```
Diffstat (limited to 'models')
-rw-r--r-- | models/actions/task.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/actions/task.go b/models/actions/task.go index 1e279659c7..9946cf5233 100644 --- a/models/actions/task.go +++ b/models/actions/task.go @@ -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})) } |