Skip to content

Commit ba0426e

Browse files
authored
Revise PGP key export instructions to copy most recently created public key
1 parent 02563df commit ba0426e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

practices/guides/commit-signing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ If you have already committed and need to retrospectively sign commits, follow t
4747
1. Review your inputs and press enter `O` to confirm
4848
1. Define a passphrase for the key
4949

50-
1. Test the key is visible and export the PGP public key (to your clipboard):
50+
1. Test the key is visible, then export the [most recently generated] PGP public key (to your clipboard):
5151

5252
```bash
53-
gpg -k # This should list the new key
54-
gpg --armor --export <my_email_address> | pbcopy
53+
gpg -k
54+
gpg --armor --export $(gpg --list-secret-keys --with-colons | grep '^sec:' | tail -n 1 | cut -d: -f5) | pbcopy
5555
```
5656

5757
> Your PGP public key is now in your clipboard!
@@ -110,11 +110,11 @@ If you have already committed and need to retrospectively sign commits, follow t
110110
1. Review your inputs and press enter `O` to confirm
111111
1. A new window called pinentry will appear prompting you to enter a passphrase.
112112
113-
1. Test the key is visible and export the PGP public key (to your clipboard):
113+
1. Test the key is visible, then export the [most recently generated] PGP public key (to your clipboard):
114114
115115
```bash
116-
gpg -k # This should list the new key
117-
gpg --armor --export <my_email_address> | clip
116+
gpg -k
117+
gpg --armor --export $(gpg --list-secret-keys --with-colons | grep '^sec:' | tail -n 1 | cut -d: -f5) | clip
118118
```
119119
120120
> Your PGP public key is now in your clipboard!
@@ -208,7 +208,7 @@ The workflow would then use a Personal Access Token, stored with the GPG private
208208
```yaml
209209
steps:
210210
- name: Checkout
211-
uses: actions/checkout@v5
211+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
212212
with:
213213
token: ${{ secrets.BOT_PAT }}
214214
ref: main

0 commit comments

Comments
 (0)