Skip to content

Commit df0fa63

Browse files
committed
Fix GPG import - use temp file instead of process substitution
The 3<<< syntax doesn't work reliably. Use temp file approach: - Write key to temp file - Pipe passphrase to gpg --passphrase-fd 0 - Import from temp file - Clean up temp file
1 parent 25ea9aa commit df0fa63

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,16 @@ jobs:
243243
# Start gpg-agent with loopback pinentry
244244
gpg-agent --daemon --allow-loopback-pinentry
245245
246-
# Import the subkey using passphrase via file descriptor
247-
# Use process substitution to provide passphrase on fd 3, key on stdin
248-
gpg --batch --yes --pinentry-mode loopback --passphrase-fd 3 --import 3<<< "$GPG_PASSPHRASE" <<< "$GPG_PRIVATE_KEY"
246+
# Import the subkey using passphrase
247+
# Write key to temp file, then import with passphrase
248+
KEY_FILE=$(mktemp)
249+
echo "$GPG_PRIVATE_KEY" > "$KEY_FILE"
250+
251+
# Import with passphrase via --passphrase-fd 0 (stdin)
252+
echo "$GPG_PASSPHRASE" | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --import "$KEY_FILE"
253+
254+
# Clean up temp file
255+
rm -f "$KEY_FILE"
249256
250257
# Trust the key (required for signing)
251258
# Use ultimate trust (6) for the subkey

0 commit comments

Comments
 (0)