Skip to content

Load gpg key without external action #4784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/release-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@ jobs:
- name: Load GPG key
id: gpg
if: inputs.gpg-fingerprint
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ inputs.gpg-fingerprint }}
env:
PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
FINGERPRINT: ${{ inputs.gpg-fingerprint }}
run: |
# Import the private key from the GH secrets
echo "$PRIVATE_KEY" | gpg --import --batch --passphrase "$PASSPHRASE" -
# For debugging, show the contents of the keyring
gpg --list-keys --list-options show-unusable-subkeys=yes --with-subkey-fingerprint $FINGERPRINT
# Extract the email address
EMAIL=$(gpg --list-keys --with-colons $FINGERPRINT | head -n1 | awk -F: '$1=="uid" {match($10, /<([^>]+)>/, a); print a[1]}')
echo "email=$EMAIL" >> $GITHUB_OUTPUT

- name: Get draft release
id: draft-release
Expand Down