|
1 | 1 | name: Assign Committer
|
2 | 2 | on:
|
| 3 | + # Important security note: Do NOT use `actions/checkout` |
| 4 | + # or any other method for checking out the pull request's source code. |
| 5 | + # This is because the pull request's source code is untrusted, but the |
| 6 | + # GITHUB_TOKEN has write permissions (because of the `on: pull_request_target` event). |
| 7 | + # |
| 8 | + # Quoting from the GitHub Docs: |
| 9 | + # > For workflows that are triggered by the pull_request_target event, the GITHUB_TOKEN is granted |
| 10 | + # > read/write repository permission unless the permissions key is specified and the workflow can access secrets, |
| 11 | + # > even when it is triggered from a fork. |
| 12 | + # > |
| 13 | + # > Although the workflow runs in the context of the base of the pull request, |
| 14 | + # > you should make sure that you do not check out, build, or run untrusted code from the pull request with this event. |
| 15 | + # |
| 16 | + # Source: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target |
| 17 | + # |
| 18 | + # See also: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ |
3 | 19 | pull_request:
|
4 | 20 | types: [opened, reopened, ready_for_review]
|
5 | 21 |
|
|
11 | 27 | runs-on: ubuntu-latest
|
12 | 28 | if: ${{ github.event.pull_request.draft != true }}
|
13 | 29 | steps:
|
| 30 | + # Important security note: As discussed above, do NOT use `actions/checkout` |
| 31 | + # or any other method for checking out the pull request's source code. |
| 32 | + # This is because the pull request's source code is untrusted, but the |
| 33 | + # GITHUB_TOKEN has write permissions (because of the `on: pull_request_target` event). |
14 | 34 | - name: Add Assignee
|
15 | 35 | uses: actions/github-script@v7
|
16 | 36 | with:
|
|
0 commit comments