#!/bin/bash #Importing gpg key via cli #https://d.sb/2016/11/gpg-inappropriate-ioctl-for-device-errors FILE="$1" GPG_KEY="$2" GPG_PASS="$3" GPG_DIR="/root/.gnupg" mkdir -p "$GPG_DIR" if [[ -f "$GPG_KEY" ]]; then GPG_KEY=$(cat "$GPG_KEY") fi #Trim single quotes if it has any. (Single quotes are needed for ACT) GPG_KEY=$(echo "$GPG_KEY" | tr -d \') gpg --homedir "$GPG_DIR" --allow-secret-key-import --import --batch --passphrase "$GPG_PASS" <> "$GITHUB_OUTPUT" exit $RESULT