gitPrivateKey from Environment Variable is Missing Newline #34237
Unanswered
philipp-holler
asked this question in
Request Help
Replies: 2 comments 4 replies
-
You're welcome to submit a PR which ensures a new line is present at the end of the string before writing it out to disk |
Beta Was this translation helpful? Give feedback.
3 replies
-
@philipp-holler this should now be fixed as #34674 is released in https://github.com/renovatebot/renovate/releases/tag/39.192.0. Got working verified commits now on my end anyways! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
GitLab, 39.170.1
Please tell us more about your question or problem
I am trying to use
gitPrivateKey
to configure commit signing in Renovate.In my
config.js
file, I have configured it via the linegitPrivateKey: process.env.COMMIT_SIGNING_KEY
, loading the signing key via an environment variable (I also tried it via a secret loaded from the environment variable and{{ secrets.COMMIT_SIGNING_KEY }}
as the value forgitPrivateKey
, but this led to Renovate not recognizing the key as SSH anymore, because, I assume, the secret wasn't resolved to its actual value).During the Renovate run, the key is correctly written to the file
/tmp/git-private-ssh.key
. However the file does not contain a trailing newline, even when there was one in the environment variable, and therefore the workaroundssh-keygen
call fails with anerror in libcrypto
message. Everything works fine when I put my private key directly into theRENOVATE_GIT_PRIVATE_KEY
variable (i.e. the same environment variable contents, just not passed through the file config).I assume my trailing newline is trimmed out somewhere, but I'm not sure where and I don't quite understand how I am supposed to configure the key correctly through the configuration file without this happening.
I did find this existing, related discussion, not the answers in there are mostly about the need for the trailing newline, not about how to preserve it through the loading via configuration.
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions