Skip to content

Commit

Permalink
find and use the secret subkey fingerprint which can be used for sign…
Browse files Browse the repository at this point in the history
…ing operations
  • Loading branch information
jiaqiluo committed Oct 16, 2024
1 parent d258575 commit 31ea737
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ jobs:
echo "Importing gpg key"
echo -n "$GPG_KEY" | base64 --decode | gpg --import --batch >/dev/null
# Print the list of secret key
gpg --list-secret-keys --with-colons
# Extract only the first full fingerprint from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10; exit}')
# Extract the correct secret subkey fingerprint
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^ssb/ {found=1} found && /^fpr/ {print $10; exit}')
echo "Extracted GPG Key ID: $GPG_KEY_ID"
# Automatically trust the key by creating a trust level entry for the key (ultimate trust)
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ jobs:
echo "Importing gpg key"
echo -n "$GPG_KEY" | base64 --decode | gpg --import --batch >/dev/null
# Print the list of secret key
gpg --list-secret-keys --with-colons
# Extract only the first full fingerprint from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10; exit}')
# Extract the correct secret subkey fingerprint
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^ssb/ {found=1} found && /^fpr/ {print $10; exit}')
echo "Extracted GPG Key ID: $GPG_KEY_ID"
# Automatically trust the key by creating a trust level entry for the key (ultimate trust)
Expand Down

0 comments on commit 31ea737

Please sign in to comment.