File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515jobs :
1616 pr :
17- name : Check PR Title
17+ name : Label and Check PR Title
18+ permissions :
19+ contents : read # `actions/labeler` reads `.github/labeler.yml` via the GitHub API
20+ pull-requests : write # `actions/labeler` adds labels to the PR, requires write permission
1821 runs-on : ubuntu-slim
1922 steps :
23+ # This step can only be run on internal PRs (i.e. from core contributors who have write access to the repo).
24+ # The simplest way to extend it to external contributors making PRs from forks would be to switch to a
25+ # `pull_request_target` event, but we don't want to do that due to the security risks of `pull_request_target`
26+ # (see PR #21566).
27+ - uses : actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
28+ # Skip on PRs from forks.
29+ # In `pull_request` events, `GITHUB_TOKEN` is read-only for PRs from forks, so adding labels would fail.
30+ if : github.event.pull_request.head.repo.full_name == github.repository
31+
2032 - name : Validate PR title
2133 env :
2234 TITLE : ${{ github.event.pull_request.title }}
You can’t perform that action at this time.
0 commit comments