Hey visitors! If you’re a beginner in WordPress and WP-CLI development, then you should check out my dear friend Bhargav’s Youtube channel! @BuntyWP

Setting Multiline GitHub Secret key using GitHub CLI

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 <<EOFCode 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

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

Powered by WordPress