0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-10 04:56:59 +01:00
This commit is contained in:
Excellencedev 2026-01-16 17:09:41 +01:00
parent 87d9f86391
commit 01a328bed0
2 changed files with 5 additions and 0 deletions

View File

@ -273,6 +273,10 @@ func GetActionsUserRepoPermission(ctx context.Context, repo *repo_model.Reposito
return perm, err
}
if err := repo.LoadOwner(ctx); err != nil {
return perm, err
}
actionsUnit, err := repo.GetUnit(ctx, unit.TypeActions)
if err != nil {
// If Actions unit doesn't exist, return empty permission

View File

@ -280,6 +280,7 @@ func TestActionsTokenPermissionsClamping(t *testing.T) {
// Set Clamping Config: Custom Mode (Default=Max), Max Code = Read
req := NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s/settings/actions/general/token_permissions", repo.OwnerName, repo.Name), map[string]string{
"override_org_config": "true",
"token_permission_mode": "custom",
"max_code": "read",
})