updated isPublicRepository check to cache results