Skip to content

Commit 7ee0f93

Browse files
author
Martin Lopes
authored
Merge pull request #1354 from ylemkimon/patch-1
Add warning regarding `pull_request_target` event
2 parents 7a9f4bf + e333c2a commit 7ee0f93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

content/actions/reference/events-that-trigger-workflows.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ on:
578578

579579
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.
580580

581+
{% warning %}
582+
583+
**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.
584+
585+
{% endwarning %}
586+
581587
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
582588
| --------------------- | -------------- | ------------ | -------------|
583589
| [`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 |

0 commit comments

Comments
 (0)