The Install SSH Key action requires two inputs - key and known_hosts value. The only action that worked for me was Shimataro’s Install SSH Key. I’m assuming you already know how to create a basic Github Actions file, so I’ll only talk about steps for adding the SSH Key here.Īdding the private key is a complex business, I chose to look for available Github Actions here. Step 4: Adding the Private key to a Github Actions Workflow Here, you’ll see SSH_PRIVATE_KEY under the repository’s secrets. Next, click on “Add secret” and you’ll be brought back to the secrets page. We need to copy everything and paste it inside the Secret value I just wanted to show you exactly what to expect :)). (Don’t worry about me exposing this key, I trashed it already. In this case, I chose to name the secret SSH_PRIVATE_KEY.įor the value, we need to go back into your server and open up the github-actions private key. This is a format we usually use for specifying secrets. When you write your secret name, please use uppercase letters with underscores as spaces (as shown in the placeholder). The secret name is used to get the contents later in a Github Actions workflow. This secret contains two things - a secret name and the contents. You should see a button that says “New repository secret”.Ĭlick “New repository secret” and you’ll be prompted to enter a secret. Go to your repository on Github and click on “Settings”, then “Secrets”. Be careful! Step 3: Adding the private key to your repository’s secrets Double means append, while single means overwrite. Note: Make sure you use double-right-angled brackets ( >) and not single-angled brackets ( >).
0 Comments
Leave a Reply. |