Skip to content

Commit

Permalink
Add GitHub troubleshooting ops recipe (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
uvegla committed Mar 20, 2024
1 parent d456a98 commit f3506ea
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions content/docs/support-and-ops/ops-recipes/troubleshooting-github.md
@@ -0,0 +1,32 @@
---
title: "Troubleshooting GitHub"
owner:
- https://github.com/orgs/giantswarm/teams/team-honeybadger
confidentiality: public
---

Troubleshooting GitHub related issues.

# Table of Contents
1. [Deploy key is already in use](#deploy-key-is-already-in-use)

## Deploy key is already in use

Deploy keys are a great way to limit access to a single GitHub repository. The public part of the SSH key is attached
directly to the repository instead of a personal account. The keys are by default granted only read permission on the
repository. Optionally they can be granted write access where it can perform the same actions as an organization
member with admin access.

A deploy key can be attached to a single repository only. Adding it to another one will result in a `Key is already in use` error.

However, you can technically get this error when you added the key to a repository that no longer exists / was deleted
recently. You probably don't want to reuse the key in such a case but instead generate a new pair and use that.

If for some reason you want to reuse the key and the repository where it was attached is deleted, the reason is that
GitHub "soft" deletes repositories. It still exists for a time for restoration and the key is still attached to it, it
is just completely hidden.

1. Organization repositories can be restored under the GitHub organization settings page under `Deleted Repositories`.
2. Once the repository is restored, remove the key under the `/settings/keys`.
3. Delete the restored repository again if you don't need it anymore.
4. Add the key to the new repository.

0 comments on commit f3506ea

Please sign in to comment.