You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to deploy to cloud run and one of the env_vars has a value that is multi line, specifically it is a PEM key.
This seems to make the key not be used properly in cloud run UI.
The problem is with GH_APP_PRIVATE_KEY
Tried with with both "" and without.
In the google console UI the output looks like this
This might be a yaml question more than a deploy-cloudrun one.
Encode the PEM (e.g. base64) so it's safe to transport as a single line. Your application or workflow would need to decode it on the other side though.
Escape the newline on each row with a backslash (this is a fake private key we use in tests):
Activity
sethvargo commentedon Dec 20, 2024
Have you tried:
If so, please provide the debug logs.
onel commentedon Dec 21, 2024
Yes, I've tried with quotes as well.
This is the log output specifically for the deploy job (the link expires in 1 week)
https://pastebin.com/r75Qjzaq
sethvargo commentedon Dec 21, 2024
Pasting the relevant bits here for history:
It looks like parsing is actually successful, but then re-serialization is incorrect.
onel commentedon Dec 29, 2024
I see, so this might be a
deploy-cloudrunbug?Azzerty23 commentedon Apr 6, 2025
Is there a workaround for this?
onel commentedon Apr 21, 2025
The workaround I went with is adding the PEM keys to the repo and loading them if dev / prod. Not ideal
sethvargo commentedon Apr 21, 2025
There are a couple options:
Remove the newlines from the PEM:
awk 'NF {sub(/\nr\r?/, ""); printf "%s\\n",$0;}'Encode the PEM (e.g. base64) so it's safe to transport as a single line. Your application or workflow would need to decode it on the other side though.
Escape the newline on each row with a backslash (this is a fake private key we use in tests):
antoinedeschenes commentedon May 7, 2025
I imagine a good enhancement would be to support the same multiline syntax as GITHUB_ENV https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings