Open ChristopherA opened 3 years ago
Thanks @ChristopherA
@ChristopherA currently in the script the user has to upload their public key block to github before being able to sign commits. Is there a way to do that for them, in the script? Otherwise I'm not sure I understand why I would want to grab their GPG key from github in the script if it wouldn't be there yet?
A few different thoughts here.
If they already have a GPG key, you don't want to create a new one. You can download the key to the .gnupg folder and ask the user for the private key file.
I do presume that there is some way to upload a new gpg key, as gh
does upload the ssh key it creates for you. Fortunately to do that the auth should be is available from gh
as they have to have a token that is scoped to add that ssh public key.
You can also use this test at a different point in the process, which is to confirm that the GPG key is posted AND is the correct key. You will not get recognition that your posted commit is valid unless the commit is signed AND the matches the email address in the public key.
Got it. I presumed the script would mostly be for a fresh install and new keys. But those make sense and increase robustness. I'll work on it a bit today but mostly tomorrow. Will ping you if needed. Thanks
@namcios,
You might find these code snippets useful: