Sounds good in theory. But if enough companies started doing this, I can guarantee you that Indian companies will spring that will offer to create an open source project for you for $100 to $1000 depending on complexity of project, and amount of activity the github profile would show.
I wish I was kidding.
While that is sort of true for a take-home test, there is still value in giving candidates an online or in-person programming task that needs to be completed in a small amount of time (e.g. 1 hour)