Skip to content

Commit 26a2ee3

Browse files
committed
Enhance GPG configuration with explicit default key and agent settings
1 parent 7c7c8ee commit 26a2ee3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/maven-central.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ jobs:
2828
gpg --batch --import private.key
2929
echo "Trusting GPG key..."
3030
echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust
31+
echo "Setting default key..."
32+
echo "default-key ${{ secrets.GPG_KEYNAME }}" >> ~/.gnupg/gpg.conf
33+
echo "Setting GPG agent..."
34+
echo "use-agent" >> ~/.gnupg/gpg.conf
35+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
36+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
37+
echo "GPG configuration:"
38+
cat ~/.gnupg/gpg.conf
3139
echo "Listing GPG keys..."
3240
gpg --list-secret-keys --keyid-format LONG
3341
gpg --list-keys --keyid-format LONG
@@ -49,7 +57,7 @@ jobs:
4957
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
5058
-Dgpg.executable=gpg \
5159
-Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \
52-
-Dgpg.useagent=false \
60+
-Dgpg.useagent=true \
5361
-Dmaven.test.failure.ignore=false \
5462
-X
5563

0 commit comments

Comments
 (0)