It was a pain in the ass figuring out why the end-to-end tests were failing on the pipeline. We enabled video recording in Cypress to upload as GitHub artifact on failure and found the multi-line private key was being incorrectly set.
So if you ever come across this post wondering how to set a multi-line GitHub secret via the GitHub CLI, these are the steps:
Run the following
gh secret set PLUGIN_PRIVATE_KEY <<EOF
Code language: Bash (bash)
This will print heredoc>
to the shell.
Paste your multi-line key
-----BEGIN PRIVATE KEY-----
MIGTAgEAMthisissonotgoingtoworkGSM49AwEHBHkwdwIBAQQgxfFO/7WMg3TX
DGF7P5mhahayougotmethere3segCgYIKoZIzj0DAQehRANCAAQES42uAX2gDIPx
aUwN3PE3ZG39XpB2n9u9uidP37fGlOJa6gfemLxTfo3irCbQK5Biathisisfake/
X51PWjOh
-----END PRIVATE KEY-----
Code language: Bash (bash)
Press Enter
And the type heredoc> EOF
This will set your key. That’s it!
Leave a Reply