This commit is contained in:
Zettat123 2024-11-28 10:25:28 +08:00
parent cbaa5ff0ed
commit 527998db03

View File

@ -201,10 +201,8 @@ func httpBase(ctx *context.Context) *serviceHandler {
} }
actionsCfg := repo.MustGetUnit(ctx, unit.TypeActions).ActionsConfig() actionsCfg := repo.MustGetUnit(ctx, unit.TypeActions).ActionsConfig()
if !actionsCfg.IsCollaborativeOwner(task.Repo.OwnerID) || !task.Repo.IsPrivate { if !actionsCfg.IsCollaborativeOwner(task.Repo.OwnerID) || !task.Repo.IsPrivate {
// See https://docs.github.com/en/actions/sharing-automations/sharing-actions-and-workflows-from-your-private-repository // The task repo can access the current repo only if the task repo is private and
// Any actions or reusable workflows stored in the private repository can be used in // the owner of the task repo is a collaborative owner of the current repo.
// workflows defined in other private repositories owned by the same organization or user.
// Actions and reusable workflows stored in private repositories cannot be used in public repositories.
ctx.PlainText(http.StatusForbidden, "User permission denied") ctx.PlainText(http.StatusForbidden, "User permission denied")
return nil return nil
} }