From c7d20802afdde2e7a70e460c53d4091ad308e1f9 Mon Sep 17 00:00:00 2001 From: Excellencedev Date: Fri, 26 Dec 2025 09:54:36 +0100 Subject: [PATCH] LOGS --- routers/api/packages/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routers/api/packages/api.go b/routers/api/packages/api.go index 49ef440d03..5f17344915 100644 --- a/routers/api/packages/api.go +++ b/routers/api/packages/api.go @@ -4,6 +4,7 @@ package packages import ( + "fmt" "net/http" actions_model "code.gitea.io/gitea/models/actions" @@ -108,11 +109,13 @@ func reqPackageAccess(accessMode perm.AccessMode) func(ctx *context.Context) { // If package is not linked to any repo (org-level package), deny access from Actions // Actions tokens should only access packages linked to repos if packageRepoID == 0 { + fmt.Printf("DEBUG: packageRepoID is 0 for pkgID %d. Denying access.\n", ctx.Package.Descriptor.Package.ID) ctx.HTTPError(http.StatusForbidden, "reqPackageAccess", "Actions tokens cannot access packages not linked to a repository") return } if task.RepoID != packageRepoID { + fmt.Printf("DEBUG: taskRepoID %d != packageRepoID %d. Checking cross-repo.\n", task.RepoID, packageRepoID) // Cross-repository access - check org policy cfg, err := actions_model.GetOrgActionsConfig(ctx, ctx.Package.Owner.ID) if err != nil {