I think you're missing the point. Researchers literally could upload their work to github if they wanted to right now. They choose to publish in journals because the reputation means their work will get seen and will have credibility with other researchers. It's a bit like Big-4 auditing in a sense. They don't do anything particularly special, but their size and reputation give credibility to their audits that wouldn't otherwise be possible. And like journals, they have had some spectacular failures that are dwelt upon, but in general they make vetting much easier.