`git clone project2` in gitlab-ci.yml?

I’d like Gitlab CI to fetch source code of another project. Is there a better way than adding a read-only deploy key and setting it up in .gitlab-ci.yml?