Cloning private repo with a Github App private key


I was wondering if it is possible to clone a private repository using a Github App private key.

Is it possible?

If so, do you know which permissions it requires to do so?

I tried giving it “Contents” read-only permissions, but it still cannot clone it…

The way I test it is by using:

ssh-agent bash -c 'ssh-add {{private_key_file.pem}}; git clone{{username}}/{{repo}}.git'

Did you find a solution?

I am trying to clone private repositories with my Github App aswell.

I just found a way that works for me using the command line. at the very bottom

git clone https://x-access-token:<token>

I am retrieving a user token using a POST request to$installationId/access_tokens.