Skip to content

Commit

Permalink
Merge pull request #1354 from ylemkimon/patch-1
Browse files Browse the repository at this point in the history
Add warning regarding `pull_request_target` event
  • Loading branch information
Martin Lopes authored Dec 15, 2020
2 parents 7a9f4bf + e333c2a commit 7ee0f93
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions content/actions/reference/events-that-trigger-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ on:

This event is similar to `pull_request`, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.

{% warning %}

**Warning**: When using the `pull_request_target` event, be aware that it runs in the context of the base repository. This means that the `GITHUB_TOKEN` has write access to the repository, and the cache shares the same scope as the base branch. As a result, do not run untrusted code in the same context, as there is a risk that it may access sensitive information and unexpectedly manipulate the workflow environment. In addition, to help prevent cache poisoning, do not save the cache if there is a possibility that the cache contents were altered.

{% endwarning %}

| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
| --------------------- | -------------- | ------------ | -------------|
| [`pull_request`](/webhooks/event-payloads/#pull_request) | - `assigned`<br/>- `unassigned`<br/>- `labeled`<br/>- `unlabeled`<br/>- `opened`<br/>- `edited`<br/>- `closed`<br/>- `reopened`<br/>- `synchronize`<br/>- `ready_for_review`<br/>- `locked`<br/>- `unlocked` <br/>- `review_requested` <br/>- `review_request_removed` | Last commit on the PR base branch | PR base branch |
Expand Down

0 comments on commit 7ee0f93

Please sign in to comment.