hasura / smooth-checkout-buildkite-plugin

All the things you need during a Buildkite checkout :butter: :kite:
Apache License 2.0
14 stars 12 forks source link

error while cloning multiple private repositories #19

Closed imperfect-fourth closed 2 years ago

imperfect-fourth commented 2 years ago

https://buildkite.com/hasura/graphql-engine-mono/builds/2166#df686b8c-09d3-4583-a7e9-0d874be18587

SSH keys are added using the smooth-secrets plugin. When cloning through git@github:<org>/<repo> urls, the first key that matches the host(i.e. github.com) is accepted for authentication. But, since that key doesn't have permissions to clone other private repositories, the git clone fails.

Github suggests adding aliases in ssh config. But this seems hard to implement because we will need to modify the smooth-secrets plugin to add hostname aliases for the ssh keys that it adds and then use those aliases here. It would make this plugin dependent on the smooth-secrets plugin.

I propose that we add an optional config field key_path with which we can specify the path to the private key and use this approach to clone the repo(this method has already been used in our system here)