Member-only story

Clone private repository for Github Actions of another repository

D
2 min readFeb 14, 2023

--

Step 0: Terminology

For brevity let’s refer to the repository running the Github Actions as action_repo and the private repository that is a dependency as private_repo.

Step 1: Create private and public keys

  1. ssh-keygen -t ed25519 -C “some@email.com” should do the trick
  2. This creates 2 files — one with the name provided and one with the name provided and the extension .pub as can be seen in the image above.

Step 2: Head over to action_repo

Add a repository secret and dump the contents of the private key file (this is the file without the .pub extension). In the image below this secret is called PRIVATE_REPOSITORY. Take note that the contents of the private key file should be copied in full with white spaces and all. This is because private and public keys are sensitive and even white spaces or ending comments are part of the entire contents.

secret of private key

Step 3: Head over to the private_repo

Add the public key (the one ending in .pub) to the Deploy keys section of this repository.

--

--

D
D

Written by D

An aspiring Robotics Researcher. I am currently in my 4th year of undergraduate studies. I am working on optimising the ROS navigation packages. Follow 4 more!

No responses yet