Skip to content

Commit 749e104

Browse files
authored
Clarify policy for explicitly requested upstream pushes (#2645)
1 parent fc4467d commit 749e104

1 file changed

Lines changed: 24 additions & 10 deletions

File tree

‎AGENTS.md‎

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,30 @@ guide for package-specific conventions and workflows.
1414

1515
# Pull requests
1616

17-
**Never push branches or commits to the canonical upstream repository. Treat
18-
it as read-only.** Branch creation and pushes for pull-request work must go to
19-
an approved fork associated with the contributor. The fork may be owned by the
20-
contributor's personal account or by an organization.
21-
22-
Before pushing, run `git remote -v` and confirm that the intended push remote
23-
points to a fork of the pull-request base, not to the base repository itself.
24-
Compare complete `OWNER/REPOSITORY` names; do not rely on remote names such as
25-
`origin` or `upstream`, or on the owner alone. Do not use `git push upstream`
26-
or any command that writes to the upstream remote.
17+
Treat the canonical upstream repository as read-only by default. For normal
18+
pull-request work, push branches and commits to an approved fork associated
19+
with the contributor. The fork may be owned by the contributor's personal
20+
account or by an organization.
21+
22+
Before any push, run `git remote -v` and verify the complete
23+
`OWNER/REPOSITORY` of the intended destination. For normal pull-request work,
24+
confirm that the destination is a fork of the pull-request base. Do not rely
25+
on remote names such as `origin` or `upstream`, or on the owner alone.
26+
27+
An upstream push is allowed when the user explicitly requests it and provides
28+
a rationale for why the upstream repository is needed, such as testing
29+
`.github/workflows`, triggering CI from a designated upstream ref, or other
30+
infrastructure work.
31+
32+
For an authorized upstream push, verify the exact source and destination refs
33+
against the user's request. If the repository and refspec are unambiguous,
34+
proceed; do not require the user to perform the push manually solely because
35+
the destination is upstream.
36+
37+
Authorization is limited to the requested ref update. It does not authorize
38+
pushing to a default or protected branch, force-pushing, creating tags, or
39+
deleting refs unless the user separately and explicitly requests those
40+
operations.
2741

2842

2943
# General

0 commit comments

Comments
 (0)