Problem with gnupg

I’m trying to setup GA tests for GitHub - pear/Crypt_GPG: Encrypt/decrypt PGP messages with PHP

The library is using gpg cli. It looks like there’s some problem with gpg-agent.

ERROR: gpg: can't connect to the agent: IPC connect call failed
ERROR: gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
ERROR: gpg: migration aborted

A sample command that my code executes is /usr/bin/gpg --status-fd '3' --command-fd '4' --no-secmem-warning --no-tty --no-default-keyring --no-options --no-permission-warning --exit-on-status-write-error --trust-model always --pinentry-mode loopback --ignore-time-conflict --ignore-valid-from --with-colons --with-fingerprint --with-fingerprint --fixed-list-mode --homedir '/home/runner/work/Crypt_GPG/Crypt_GPG/tests/test-keychain' --utf8-strings --list-secret-keys 'first-keypair@example.com'.

I’ve found that it might be a TTY issue mentioned in Not a tty · Issue #241 · actions/runner · GitHub