From 98f76b1158e862ff1ed07602f86cb11dd3716345 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 27 May 2021 20:05:28 +0000 Subject: [PATCH] Give an example of how to add a key comment Co-authored-by: rr-james-hickman --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41d5e4b..452b122 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ When using **Github deploy keys**, GitHub servers will accept the _first_ known To support picking the right key in this use case, this action scans _key comments_ and will set up extra Git and SSH configuration to make things work. -1. When creating the deploy key for a repository like `git@github.com:owner/repo.git` or `https://github.com/owner/repo`, put that URL into the key comment. +1. When creating the deploy key for a repository like `git@github.com:owner/repo.git` or `https://github.com/owner/repo`, put that URL into the key comment. (Hint: Try `ssh-keygen ... -C "git@github.com:owner/repo.git"`.) 2. After keys have been added to the agent, this action will scan the key comments. 3. For key comments containing such URLs, a Git config setting is written that uses [`url..insteadof`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf). It will redirect `git` requests to URLs starting with either `https://github.com/owner/repo` or `git@github.com:owner/repo` to a fake hostname/URL like `git@...some.hash...:owner/repo`. 4. An SSH configuration section is generated that applies to the fake hostname. It will map the SSH connection back to `github.com`, while at the same time pointing SSH to a file containing the appropriate key's public part. That will make SSH use the right key when connecting to GitHub.com.