Nearly correct.
You want project.repositories.add(...) in your apply method.
project.repositories.add(...)
apply
Cheers, Eric