1
0
Fork 0
mirror of https://github.com/actions/checkout synced 2024-11-14 01:22:39 +00:00

Add deploy key scenario to README

This commit is contained in:
Oliver Peate 2020-07-13 15:37:10 +01:00 committed by GitHub
parent 61b9e3751b
commit 7c625ee866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,6 +174,8 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
## Checkout multiple repos (private) ## Checkout multiple repos (private)
### Using a personal access token
```yaml ```yaml
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -190,6 +192,23 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
> - `${{ github.token }}` is scoped to the current repository, so if you want to checkout a different repository that is private you will need to provide your own [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). > - `${{ github.token }}` is scoped to the current repository, so if you want to checkout a different repository that is private you will need to provide your own [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
### Using a deploy key
Unlike personal access tokens, [deploy keys](https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys) can be scoped to a specific repository.
```yaml
- name: Checkout
uses: actions/checkout@v2
with:
path: main
- name: Checkout private tools
uses: actions/checkout@v2
with:
repository: my-org/my-private-tools
ssh-key: ${{ secrets.PRIVATE_DEPLOY_KEY }} # `PRIVATE_DEPLOY_KEY` is a secret that contains your private deploy key
path: my-tools
```
## Checkout pull request HEAD commit instead of merge commit ## Checkout pull request HEAD commit instead of merge commit