For anyone looking to add commit signing (GPG) #334
Replies: 2 comments
-
Thanks for sharing @ericsizemore. |
Beta Was this translation helpful? Give feedback.
-
This worked great to get signed commits working, thanks! Does anyone have a clever solution to allow those signed commits to be considered "verified" by Github and pass the "Require signed commits" restriction? It looks like I will have to use an email address that we control and actually add it with the public key to someone's Github account, and that just doesn't feel right. Do you have to create a dedicated service account just for this purpose or is there an easier way? |
Beta Was this translation helpful? Give feedback.
-
Hello all.
Wasn't sure if this was the correct category; my apologies if not. I did perform a search but didn't come up with anything related to this, other than issue #132
I was using another action to add and commit until recently, when it started experiencing issues with my branch protection rules. I came across this action and decided to give it a try. I wanted to share a recent workflow update that, thus far, appears to be working for signing commits with a GPG key. I would imagine it could be tweaked, as I am not that well versed with GitHub actions as I would like. There are few things to note:
secrets.PAT
)https://github.com/yourusername/yourrepo/settings/secrets/actions/new
:secrets.GPG_PRIVATE_KEY
,secrets.GPG_PASSPHRASE
)Allow force-pushes
under my branch protection rules. I also enabledSpecify who can force push
with myself listed.steps.import-gpg.outputs.name
andsteps.import-gpg.outputs.email
will use the information tied to the GPG key. Of course, the key you use should match the name and email address on your GitHub account.You can see the workflow run for this here. You can see the resulting commit here which shows me as the author and that it is
Verified
.Lastly, it is currently 8am and I'm running on little sleep :D If you notice any issues, or have suggestions, please let me know! I hope this helps someone that was struggling much like I was.
Regards,
Eric
Beta Was this translation helpful? Give feedback.
All reactions