Scenario: I've created two repositories inside my GitLab account: 'work' & 'project'. There are multiple branches in each of the following repos. I'm currently in the project repo and have created the .gitlab-ci.yml file.
Task: I want to copy two files 'A' & 'B' from the feature branch of 'work' repository to the current location (i.e., in the root of my project repository).
Thanks in advance :)
It's very easy, just add it to your script section
- git clone https://user:[email protected]/group/project.git
Or to download specific files
- curl --header 'Private-Token: <your_access_token>' https://gitlab.com/api/v4/projects/:id/repository/files/:filename\?ref\=:ref
Also it will be a great practice to add Private-Token to project masked varible
You can get access token here

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With