Skip to content

Commit bd85fe2

Browse files
authored
repo sync
2 parents 1b05af7 + 31e9e4c commit bd85fe2

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

content/actions/reference/encrypted-secrets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ You can check which access policies are being applied to a secret in your organi
118118

119119
### Using encrypted secrets in a workflow
120120

121-
With the exception of `GITHUB_TOKEN`, secrets are not passed to the runner when a workflow is triggered from a forked repository.
121+
{% data reusables.actions.forked-secrets %}
122122

123123
To provide an action with a secret as an input or environment variable, you can use the `secrets` context to access secrets you've created in your repository. For more information, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)" and "[Workflow syntax for {% data variables.product.prodname_actions %}](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions)."
124124

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,6 @@ on:
530530
types: [assigned, opened, synchronize, reopened]
531531
```
532532

533-
{% note %}
534-
535-
**Note:** In order to protect public repositories from malicious users, all pull request workflows raised from repository forks run with a read-only token and no access to secrets.
536-
537-
{% endnote %}
538-
539533
{% data reusables.developer-site.pull_request_forked_repos_link %}
540534

541535
#### `pull_request_review`
@@ -582,17 +576,11 @@ on:
582576

583577
#### `pull_request_target`
584578

585-
{% warning %}
586-
587-
**Warning:** The `pull_request_target` event is granted a read/write repository token and access to secrets, even from a fork. (The `pull_request` event does not grant read/write or secret access from a repository fork.) Do not check out and build or run untrusted code from pull request with this event.
588-
589-
{% endwarning %}
590-
591-
This event runs in the context of the base repository of the pull request, rather than in the merge commit as `pull_request` does. This is by design to prevent you from executing unsafe code that could alter your repository or steal any secrets you use in your workflow. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.
579+
This event runs in the context of the base of the pull request, rather than in the merge commit as the `pull_request` event does. This prevents executing unsafe workflow code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows you to do things like create workflows that label and comment on pull requests based on the contents of the event payload.
592580

593581
{% warning %}
594582

595-
**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.
583+
**Warning:** The `pull_request_target` event is granted a read/write repository token and can access secrets, even when it is triggered from a fork. Although the workflow runs in the context of the base of the pull request, you should make sure that you do not check out, build, or run untrusted code from the pull request with this event. Additionally, any caches share the same scope as the base branch, and to help prevent cache poisoning, you should not save the cache if there is a possibility that the cache contents were altered.
596584

597585
{% endwarning %}
598586

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
With the exception of `GITHUB_TOKEN`, secrets are not passed to the runner when a workflow is triggered from a forked repository.

data/reusables/developer-site/pull_request_forked_repos_link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ When you create a pull request from a forked repository to the base repository,
1010

1111
Workflows don't run on forked repositories by default. You must enable GitHub Actions in the **Actions** tab of the forked repository.
1212

13-
The permissions for the `GITHUB_TOKEN` in forked repositories is read-only. For more information, see "[Authenticating with the GITHUB_TOKEN](/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)."
13+
{% data reusables.actions.forked-secrets %} The permissions for the `GITHUB_TOKEN` in forked repositories is read-only. For more information, see "[Authenticating with the GITHUB_TOKEN](/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)."

0 commit comments

Comments
 (0)