Skip to content

Commit

Permalink
feat(action): Handle local public/private keys, adjust defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 24, 2023
1 parent 439362c commit 27b65e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ inputs:
required: true
privkey:
description: 'Private key, path to private key, or URL to retrieve private key'
default: 'https://raw.githubusercontent.com/EyeCantCU/kernel-signer/main/certs/private_key.priv.test'
default: './certs/private_key.priv.test'
required: true
pubkey:
description: 'Public key, path to public key, or URL to retrieve public key'
default: 'https://raw.githubusercontent.com/EyeCantCU/kernel-signer/main/certs/public_key.der.test'
default: './certs/public_key.der.test'
required: true
runs:
using: "docker"
Expand Down
8 changes: 6 additions & 2 deletions sign-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ if [[ "${PRIVKEY}" == /* ]]; then
else
PRIVKEY_PATH="/etc/pki/kernel/private/private_key.priv"
mkdir -p "$(dirname "$PRIVKEY_PATH")"
if [[ "${PRIVKEY}" == http* ]]; then
if [[ "${PRIVKEY}" == ./* ]]; then
cp "${PRIVKEY}" "${PRIVKEY_PATH}"
elif [[ "${PRIVKEY}" == http* ]]; then
wget -q "${PRIVKEY}" -O "${PRIVKEY_PATH}"
else
echo "${PRIVKEY}" > "${PRIVKEY_PATH}"
Expand All @@ -27,7 +29,9 @@ if [[ "${PUBKEY}" == /* ]]; then
else
PUBKEY_PATH="/etc/pki/kernel/public/public_key.der"
mkdir -p "$(dirname "$PUBKEY_PATH")"
if [[ "${PUBKEY}" == http* ]]; then
if [[ "${PUBKEY}" == ./* ]]; then
cp "${PUBKEY}" "${PUBKEY_PATH}"
elif [[ "${PUBKEY}" == http* ]]; then
wget -q "${PUBKEY}" -O "${PUBKEY_PATH}"
else
echo "${PUBKEY}" > "${PUBKEY_PATH}"
Expand Down

0 comments on commit 27b65e9

Please sign in to comment.