allow action user have read permission in public repo like other user (#36095)

related #28187

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796
2025-12-08 02:07:04 +08:00
committed by GitHub
parent b41ccb0627
commit 98ef79d73a
2 changed files with 61 additions and 1 deletions
+7 -1
View File
@@ -276,8 +276,14 @@ func GetActionsUserRepoPermission(ctx context.Context, repo *repo_model.Reposito
if !actionsCfg.IsCollaborativeOwner(taskRepo.OwnerID) || !taskRepo.IsPrivate {
// The task repo can access the current repo only if the task repo is private and
// the owner of the task repo is a collaborative owner of the current repo.
// FIXME allow public repo read access if tokenless pull is enabled
// FIXME should owner's visibility also be considered here?
// check permission like simple user but limit to read-only
perm, err = GetUserRepoPermission(ctx, repo, user_model.NewActionsUser())
if err != nil {
return perm, err
}
perm.AccessMode = min(perm.AccessMode, perm_model.AccessModeRead)
return perm, nil
}
accessMode = perm_model.AccessModeRead