Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding all GitHub Repo Deploy Keys?

I am trying to add a new SSH key to my GitHub account, but it says the key is already in use. I have hundreds of repos, and I don't want to click through each one to find out which is using this SSH key for deployments. Is there a way to automate this?

like image 926
reidjs Avatar asked Jan 19 '26 16:01

reidjs


1 Answers

My approach to list the deploy keys (not the account-level keys) of all my repos:

for repo in `gh repo list | awk '{print $1}'`;\
  do echo "==== $repo ====";\
  gh repo -R $repo deploy-key list;\
done
like image 156
cgdave Avatar answered Jan 23 '26 08:01

cgdave



Donate For Us

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