Skip to content

Commit 621b23b

Browse files
author
Marvin Zhang
committed
chore: Refine GPG configuration in GitHub Actions workflow
- Updated GPG configuration steps to use overwrite instead of append for gpg-agent and gpg settings. - Enhanced the gpg-agent restart process to ensure all instances are killed before starting a new one. - Adjusted the setting of GPG_TTY to use export for better environment variable handling.
1 parent 28afb1d commit 621b23b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ jobs:
9494
mkdir -p ~/.gnupg/
9595
9696
# Configure GPG
97-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
98-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
97+
echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
98+
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
9999
100100
# Set permissions
101101
chmod 700 ~/.gnupg
102102
chmod 600 ~/.gnupg/*
103103
104-
# Restart agent
105-
gpgconf --kill gpg-agent
106-
gpg-agent --daemon
104+
# Kill existing agent if any and restart
105+
gpgconf --kill all || true
106+
gpg-agent --daemon --allow-preset-passphrase
107107
108108
- name: Set GPG_TTY
109-
run: echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
109+
run: export GPG_TTY=$(tty)
110110

111111
- name: Reload gpg-agent
112112
run: gpg-connect-agent reloadagent /bye

0 commit comments

Comments
 (0)