Skip to content

Commit

Permalink
fix: 🐛 trial for gpg sign
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasAugustin committed Feb 5, 2024
1 parent 856280c commit 3b9a839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ function ssh_setup() {
function gpg_setup() {
echo "::group::gpg setup"
info "start prepare gpg"
GPG_TTY=$(tty)
export GPG_TTY
echo -e "$GPG_PRIVATE_KEY" | gpg --import --batch
# for fpr in $(gpg --list-key --with-colons "${GIT_USER_EMAIL}" | awk -F: '/fpr:/ {print $10}' | sort -u); do echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key "$fpr" trust; done
for fpr in $(gpg --list-key --with-colons "${GIT_USER_EMAIL}" | awk -F: '/fpr:/ {print $10}' | sort -u); do echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key "$fpr" trust; done

KEY_ID="$(gpg --list-secret-key --with-colons "${GIT_USER_EMAIL}" | awk -F: '/sec:/ {print $5}')"
git config --global user.signingkey "${KEY_ID}"
Expand Down
3 changes: 2 additions & 1 deletion src/gpg_no_tty.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash

if [[ -n "${GPG_PASSPHRASE}" ]] &>/dev/null; then
echo -e "${GPG_PASSPHRASE}" | gpg --pinentry-mode loopback --batch --yes --passphrase-fd 0 "$@" <&0
# echo -e "${GPG_PASSPHRASE}" | gpg --pinentry-mode loopback --batch --yes --passphrase-fd 0 "$@" <&0
echo -e "${GPG_PASSPHRASE}" | gpg --batch --yes --passphrase-fd 0 "$@" <&0
else
gpg --pinentry-mode loopback --yes --batch "$@" <&0
fi
Expand Down

0 comments on commit 3b9a839

Please sign in to comment.