Skip to content

Commit 7aa5cce

Browse files
committed
Do not auto-label fork pull requests
A ciflow label makes pytorchbot tag the PR head in this repo, and a tag push runs the workflow file from that commit -- the fork's copy -- with this repo's secrets and OIDC. Applying the label automatically therefore hands fork code role/arc, which can now write to ECR. Requiring a maintainer to label a fork PR is the trust gate pytorch relies on. This also closes the same path for ciflow/trunk, which the arm rules already auto-applied to fork PRs. The cost is that fork PRs no longer get the informational module labels either. Authored with Claude Code.
1 parent d4c09e3 commit 7aa5cce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ permissions:
99

1010
jobs:
1111
label:
12+
# A ciflow label makes pytorchbot tag the PR head in this repo, and a tag
13+
# push runs the workflow from that commit with this repo's secrets. Applying
14+
# one to a fork PR automatically would hand fork code those secrets, so fork
15+
# PRs are left to a maintainer.
16+
if: github.event.pull_request.head.repo.full_name == github.repository
1217
runs-on: ubuntu-latest
1318
steps:
1419
- uses: actions/labeler@v5

0 commit comments

Comments
 (0)