Skip to content

Commit

Permalink
update action
Browse files Browse the repository at this point in the history
  • Loading branch information
robzr committed Mar 5, 2024
1 parent f5e2c5f commit 0fd120e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion keys/import/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ runs:
KEY_SEARCH: ${{ inputs.search }}
KEY_URLS: ${{ inputs.key-urls }}
KEYS: ${{ steps.search.outputs.keys }}
KEYSERVER: ${{ inputs.keyserver }}
MAX_KEYS: ${{ inputs.max-keys }}
QUIET: ${{ inputs.quiet == 'true' && 'true' || 'false' }}
id: import
Expand All @@ -63,7 +64,17 @@ runs:
echo "::error title=gpg/keys/import - Too many keys found in search!::The search (${KEY_SEARCH}) returned ${KEY_COUNT} keys, which exceeds the setting of max-keys input variable (${MAX_KEYS}). Either refine the search or increase max-keys."
exit 1
fi
# TODO: import keys :)
echo '::group::Importing key(s) from keyserver'
jq '
while read -r fingerprint ; do
gpg \
--batch \
--no-tty \
--keyserver "$KEYSERVER" \
--recv-keys "$key_fingeprint" \
< /dev/null
done <$(jq -r 'map(.fingerprint)' <<<"${KEYS}")
echo '::endgroup::'
fi
if ${{ inputs.key-files == '' && 'false' || 'true' }} ; then
echo '::group::Importing key(s) from file(s)'
Expand Down

0 comments on commit 0fd120e

Please sign in to comment.