I'm running a self-hosted Renovate instance and I need to sign the commits to GitLab with GPG key.
For this I'm setting the env variable RENOVATE_GIT_PRIVATE_KEY with the PGP private key block for my GitLab user and this is automatically imported.
But I get the following error when trying to do so:
gpg: directory '/home/ubuntu/.gnupg' created
gpg: keybox '/home/ubuntu/.gnupg/pubring.kbx' created
gpg: /home/ubuntu/.gnupg/trustdb.gpg: trustdb created
gpg: key 72A96C0D4FA8543C: public key "Dummy User <[email protected]>" imported
gpg: key 72A96C0D4FA8543C/72A96C0D4FA8543C: error sending to agent: Inappropriate ioctl for device
gpg: error building skey array: Inappropriate ioctl for device
gpg: error reading '/tmp/git-private.key': Inappropriate ioctl for device
gpg: import from '/tmp/git-private.key' failed: Inappropriate ioctl for device
gpg: Total number processed: 0
gpg: imported: 1
gpg: secret keys read: 1
I did the setup following this instructions https://docs.renovatebot.com/self-hosted-configuration/#gitprivatekey
I fixed the inappropriate ioctl issue by adding export GPG_TTY=$(tty) prior the command execution
You can fix it telling gpg to not rely on a terminal, like reading keyboard (stdin) and so, using the argument --batch.
Considering it is being run by a script the passphrase is expected to be provided by other means, like by --passphrase argument, so a full example:
$ gpg --batch --passphrase ${my_passphrase} --import ${key_path}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With