mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-21 16:50:50 +00:00
Better explain in the README how to set up keys in repositories (#96)
This commit is contained in:
parent
a652a400f2
commit
bbd5513ed5
1 changed files with 7 additions and 4 deletions
11
README.md
11
README.md
|
@ -20,11 +20,14 @@ GitHub Actions only have access to the repository they run for. So, in order to
|
|||
|
||||
## Usage
|
||||
|
||||
1. Create an SSH key with sufficient access privileges. For security reasons, don't use your personal SSH key but set up a dedicated one for use in GitHub Actions. See below for a few hints if you are unsure about this step.
|
||||
1. Generate a new SSH key with sufficient access privileges. For security reasons, don't use your personal SSH key but set up a dedicated one for use in GitHub Actions. See below for a few hints if you are unsure about this step.
|
||||
2. Make sure you don't have a passphrase set on the private key.
|
||||
3. In your repository, go to the *Settings > Secrets* menu and create a new secret. In this example, we'll call it `SSH_PRIVATE_KEY`. Put the contents of the *private* SSH key file into the contents field. <br>
|
||||
This key should start with `-----BEGIN ... PRIVATE KEY-----`, consist of many lines and ends with `-----END ... PRIVATE KEY-----`.
|
||||
4. In your workflow definition file, add the following step. Preferably this would be rather on top, near the `actions/checkout@v2` line.
|
||||
3. Add the public SSH key to the private repository you are pulling from during the Github Action as a 'Deploy Key'.
|
||||
4. Add the private SSH key to the repository triggering the Github Action:
|
||||
* In your repository, go to the *Settings > Secrets* menu and create a new secret. In this example, we'll call it `SSH_PRIVATE_KEY`.
|
||||
* Put the contents of the *private* SSH key file into the contents field. <br>
|
||||
* This key should start with `-----BEGIN ... PRIVATE KEY-----`, consist of many lines and ends with `-----END ... PRIVATE KEY-----`.
|
||||
5. In your workflow definition file, add the following step. Preferably this would be rather on top, near the `actions/checkout@v2` line.
|
||||
|
||||
```yaml
|
||||
# .github/workflows/my-workflow.yml
|
||||
|
|
Loading…
Reference in a new issue