O2 Script: adding the SSH Key to GitHub
Once we had TortoiseGIT installed and used PuttyGen to create the SSH key we now need to add the SSH Key to the GitHub website, which is done by automating the browser:
public static GitHub_CustomO2 add_SSH_PublicKey(this GitHub_CustomO2 gitHub)
{
var ie = gitHub.IE;
var keyPath = "What is the path to the public key to use?".askUser();
if (keyPath.fileExists().isFalse())
{
"no key file provided".error();
}
else
{
var title = System.IO.Path.GetFileNameWithoutExtension(keyPath);
var key = keyPath.fileContents();
gitHub.homePage();
gitHub.accountSettings();
ie.link("SSH Public Keys").click();
ie.link("Add another public key").click();
ie.field("public_key[title]").value(title);
ie.field("public_key[key]").value(key);
ie.button("<SPAN>Add key</SPAN>").click();
}
return gitHub;
}


[...] installing TortoiseGIT , using PuttyGen to create the SSH key and adding the SSH Key to GitHub the final step in this series is to create GIT Clone locally (this is how we check out code using [...]