Closed FabioPinheiro closed 5 years ago
Here are some pointers that signing commits can be done with gpg-agent
and gpg-preset-passphrase
: https://gitter.im/fthomas/scala-steward?at=5d2c5b8e570ac36f8d2a108a.
Thx @fthomas
@fthomas Currently having the same issue but it seems the link is stale. Do you know if the information is available anywhere else?
@arashi01 The Gitter room has moved: https://gitter.im/scala-steward-org/scala-steward?at=5d2c5b8e570ac36f8d2a108a
Thanks @fthomas !
Btw, since the chat above, the --git-author-signing-key $KEY
command-line option has been added (https://github.com/scala-steward-org/scala-steward/pull/1775). It should help Git selecting the right key for signing commits.
For posterity, the relevant bits from the chat linked in https://github.com/scala-steward-org/scala-steward/issues/758#issuecomment-962437451 are:
hi guys, in order to use the --sign-commits flag where do I have to put the GPG private key and password? I'm using the docker container for the bot
This is tricky. You have to convince git that it signs commits without asking for the GPG passphrase. I'm using gpg-agent and gpg-preset-passphrase for that.
I see the gpg-agent is available on the docker image but the utility gpg-preset-passphrase is not, do you plan to add it in the future?
ah, and for anyone interested, you can find the gpg-preset-passphrase in /usr/lib/gnupg2/gpg-preset-passphrase there isn't a /usr/bin/gpg-preset-passphrase
Hey @fthomas I don't want to bring back an old issue, but when running in Docker, should one assume that gpg
is installed?
I ask because I just realized that commits were no being signed via the instance we run internally. I tried adding --sign-commits
but it failed with:
org.scalasteward.core.io.process$ProcessFailedException: 'GIT_ASKPASS=/opt/scala-steward/scripts/echo-gh-token.sh git -c core.hooksPath=/dev/null commit --all --gpg-sign -m Update cats-effect to 3.3.14' exited with code 128.
error: cannot run gpg: No such file or directory
error: gpg failed to sign the data:
(no gpg output)
fatal: failed to write commit object
And I manually checked, and GPG is not available in the image. Should it be apk add
ed ?
Should it be
apk add
ed ?
I can't think of a good reason to not add it.
I was trying to you Scala Steward inside docker and got into an IOException when creating the PR.
java.io.IOException: error: gpg failed to sign the data
.I suspect that the problem is something in the base docker image or git configuration inside. I can try to fix. But can someone first replicate the problem or am I doing something wrong?