mirror of
https://github.com/actions/checkout.git
synced 2024-11-24 23:51:41 +08:00
Update README regarding pull_request_target
This commit is contained in:
parent
2036a08e25
commit
05aa1e5bb4
17
README.md
17
README.md
@ -119,6 +119,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
|
|||||||
- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit)
|
- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit)
|
||||||
- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)
|
- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)
|
||||||
- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)
|
- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)
|
||||||
|
- [Checkout pull request on `pull_request_target`](#Checkout-pull-request-on-pull_request_target)
|
||||||
|
|
||||||
## Fetch all history for all tags and branches
|
## Fetch all history for all tags and branches
|
||||||
|
|
||||||
@ -214,6 +215,22 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Checkout pull request on `pull_request_target`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on:
|
||||||
|
- pull_request_target
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: refs/pull/${{ github.event.pull_request.number }}/head
|
||||||
|
```
|
||||||
|
|
||||||
|
**WARNING! NEVER** run code from pull requests of public repositories! The token of `pull_request_target` event has write access.
|
||||||
|
|
||||||
## Push a commit using the built-in token
|
## Push a commit using the built-in token
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user