Skip to content

Commit

Permalink
Merge pull request #74 from signalsciences/fixbuild
Browse files Browse the repository at this point in the history
import gpg key
  • Loading branch information
jhanrahan-sigsci authored Sep 1, 2022
2 parents 5c84625 + 4ad9c56 commit a7a04c4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/actions/gpg-import.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# action.yml
name: "GPG key import"
description: "Import private GPG key"
runs:
using: "composite"
steps:
- run: |
#
echo -e "${{ env.GPG_PRIVATE_KEY }}" | gpg --import --batch --no-tty
echo "hello world" > temp.txt
gpg --detach-sig --yes -v --output=/dev/null --pinentry-mode loopback --passphrase "${{ env.PASSPHRASE }}" temp.txt
rm temp.txt
shell: bash
name: import GPG key and prime passphrase
- id: gpg-fingerprint
run: |
fingerprint=$(gpg --with-colons --list-keys | awk -F: '/^pub/ { print $5 }')
echo "::set-output name=fingerprint::$fingerprint"
shell: bash
name: set gpg fingerprint output

outputs:
fingerprint:
description: "Fingerprint of the GPG key (recommended as user ID)"
value: ${{ steps.gpg-fingerprint.outputs.fingerprint }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
-
name: Import GPG key
id: import_gpg
uses: hashicorp/ghaction-import[email protected]
uses: ./.github/actions/gpg-import
env:
# These secrets will need to be configured for the repository:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down

0 comments on commit a7a04c4

Please sign in to comment.