Describe the feature or problem you’d like to solve
Contributors can identify a user-owned fork with --head OWNER:BRANCH, but the same workflow does not support forks owned by organizations. This blocks contributors whose work lives in an organization-owned fork, including forks owned by the same organization as the upstream repository.
As a contributor working from an organization-owned fork, I want to identify the fork by its organization and branch when there is only one possible match, so that I can create a pull request without needing to provide the complete repository name.
Proposed solution
Allow gh pr create --head ORGANIZATION:BRANCH to select an organization-owned head repository when exactly one matching fork can be identified.
Feature: Create a pull request from a uniquely identifiable organization-owned fork
Scenario: The fork belongs to another organization
Given the base repository is "org/upstream"
And "other-org" owns exactly one matching fork
And the matching fork is "other-org/upstream-fork"
When the contributor runs `gh pr create --head other-org:feature-branch`
Then a pull request is created from "other-org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: The fork belongs to the same organization as the base repository
Given the base repository is "org/upstream"
And "org" owns exactly one matching fork
And the matching fork is "org/upstream-fork"
When the contributor runs `gh pr create --head org:feature-branch`
Then a pull request is created from "org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Additional context
This is a sub-issue of #10093.
This issue covers ORGANIZATION:BRANCH when exactly one matching organization-owned fork can be identified. Selecting among multiple possible forks is covered separately.
Describe the feature or problem you’d like to solve
Contributors can identify a user-owned fork with
--head OWNER:BRANCH, but the same workflow does not support forks owned by organizations. This blocks contributors whose work lives in an organization-owned fork, including forks owned by the same organization as the upstream repository.As a contributor working from an organization-owned fork, I want to identify the fork by its organization and branch when there is only one possible match, so that I can create a pull request without needing to provide the complete repository name.
Proposed solution
Allow
gh pr create --head ORGANIZATION:BRANCHto select an organization-owned head repository when exactly one matching fork can be identified.Additional context
This is a sub-issue of #10093.
This issue covers
ORGANIZATION:BRANCHwhen exactly one matching organization-owned fork can be identified. Selecting among multiple possible forks is covered separately.