dependabot / dependabot-script

A simple script that demonstrates how to use Dependabot Core
MIT License
549 stars 275 forks source link

How to sign a commit using this script #767

Open tgrieger-sf opened 2 years ago

tgrieger-sf commented 2 years ago

I am trying to use this script to open a PR with a signed commit but I am having troubles actually getting the commit signed. The account I am using has a GPG key set up in github. What I've been trying to do is pass something into the signature_key parameter on Dependabot::PullRequestCreator.new but I'm not sure if that's the right way to do it or what exactly I should be passing to that. Any help would be greatly appreciated!

codebasky commented 2 months ago

I too face the same issue. Getting 'gpgme_op_sign_result': NULL pointer given (ArgumentError)' Passed the GPG Key as signature_key parameter to Dependabot::PullRequestCreator.new.

@tgrieger-sf did you able to fix it?

`Source: {:type=>"default", :source=>"github.com/go-chi/chi/v5"}

tgrieger commented 2 months ago

I was on the right track with passing in the signature_key parameter but was just formatting it incorrectly. What I do now when I run the script is add the output of export SIGNATURE_KEY=$(gpg --export-secret-keys -a <key id>) as an environment variable and pass the environment variable value in as the signature_key parameter

testbasky commented 2 months ago

I was on the right track with passing in the signature_key parameter but was just formatting it incorrectly. What I do now when I run the script is add the output of export SIGNATURE_KEY=$(gpg --export-secret-keys -a <key id>) as an environment variable and pass the environment variable value in as the signature_key parameter

Thanks a lot @tgrieger that solved for me. I can do signed commit as well.