Github actions multi repository checkout #27030
-
Hi there, My project uses microservices architecture and each microservice is kept in a seperate repo. With github actions, if i use ‘actions/checkout@v2’ to download the base repo in one step and download a microservice repo in the next step, it deletes the previously downloaded repo and then replace it with this, is there a way i can download multip repos in sequence and able to see all the source code together to build the final system - because of the dependency in nature ? best regards |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You can do this by specifying different directories for the different directories using the |
Beta Was this translation helpful? Give feedback.
-
Thanks @airtower-luna, it allowed me to get both repo at the same time like below but the restriction in path is, it needs to be under the “/home/runner/work” is there a way i can checkout the repo to the go src directory ? |
Beta Was this translation helpful? Give feedback.
-
I wanted to add that you can do it side by side in multiple repos as mentioned in the link you provided but the downside is that you have to indicate the list of repos you want to clone in a serial manner in the yml file. In my case, I wanted to use a script I had to clone the repos I wanted (which I had listed in a txt file in my main repo). In that case, I couldn’t use the yml file to clone the repos because I didn’t know what they were at that time. So instead, I used my personal access token this way with a bash script: bash - How to clone multiple private repositories using GitHub Actions? - Stack Overflow |
Beta Was this translation helpful? Give feedback.
You can do this by specifying different directories for the different directories using the
path
parameter. See the example Checkout multiple repos (side by side) in the actions/checkout Readme.