Skip to content

Commit

Permalink
fix(plugins/git): disallow modify of local GPG conf on non-CI env
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Feb 21, 2024
1 parent 1376760 commit 9e9e0fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ prepare() {
git config --local gpg.program gpg
log_verbose "Git GPG sign and key ID [$GPG_KEY_ID] are set"
fi
if [[ -n "$GPG_PASSPHRASE" ]]; then
if [[ -n "$CI" && -n "$GPG_PASSPHRASE" ]]; then
echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf
gpg-connect-agent reloadagent /bye
Expand All @@ -43,7 +43,7 @@ cleanup() {
git config --local --unset gpg.program
log_verbose "Git GPG sign unset"
fi
if [[ -n "$GPG_PASSPHRASE" ]]; then
if [[ -n "$CI" && -n "$GPG_PASSPHRASE" ]]; then
rm -rf ~/.gnupg/gpg-agent.conf
rm -rf ~/.gnupg/gpg.conf
log_verbose "Git GPG config cleanup"
Expand Down

0 comments on commit 9e9e0fd

Please sign in to comment.