From f81a612eb195c1ca9c180a19dd72360809521067 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 19 Jul 2023 10:57:17 -0400 Subject: [PATCH] parseScope with owner/repo always sets owner to zero (#25987) (#25989) Backport #25987 by @earl-warren Refs: https://codeberg.org/forgejo/forgejo/pulls/1001 Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> --- routers/private/actions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/private/actions.go b/routers/private/actions.go index b7e416f56a..2403b9c41a 100644 --- a/routers/private/actions.go +++ b/routers/private/actions.go @@ -77,9 +77,10 @@ func parseScope(ctx *context.PrivateContext, scope string) (ownerID, repoID int6 if err != nil { return ownerID, repoID, err } + ownerID = u.ID if !found { - return u.ID, repoID, nil + return ownerID, repoID, nil } r, err := repo_model.GetRepositoryByName(u.ID, repoName)