diff --git a/routers/private/actions.go b/routers/private/actions.go
index b7e416f56..2403b9c41 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)