-
Notifications
You must be signed in to change notification settings - Fork 7k
Open
Labels
enhancementa request to improve CLIa request to improve CLIgh-prrelating to the gh pr commandrelating to the gh pr commandneeds-triageneeds to be reviewedneeds to be reviewedneeds-user-input
Description
Describe the feature or problem you’d like to solve
gh pr create -H user:branch
is limited to creating cross repo pull requests between an upstream repository and a user-owned fork due to createPullRequest
mutation limitation in the headRefName
field. Instead, these types of cross repo pull requests should specify the GraphQL ID of the upstream repository using headRepositoryId
field.
Ideally, the -H, --head branch
flag could be used with user or organization logins.
For more information, #9364 (comment)
Proposed solution
This would support intra-organization forking needs as well as simplify acceptance tests around this scenario:
cli/acceptance/testdata/pr/pr-view-status-respects-branch-pushremote.txtar
Lines 35 to 36 in f85cf1d
# Create the PR spanning upstream and fork repositories, gh pr create does not support headRepositoryId needed for private forks | |
exec gh api graphql -F repositoryId="${REPO_ID}" -F headRepositoryId="${FORK_ID}" -F query='mutation CreatePullRequest($headRepositoryId: ID!, $repositoryId: ID!) { createPullRequest(input:{ baseRefName: "main", body: "Feature Body", draft: false, headRefName: "feature-branch", headRepositoryId: $headRepositoryId, repositoryId: $repositoryId, title:"Feature Title" }){ pullRequest{ id url } } }' |
Additional context
HannesGitH
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgh-prrelating to the gh pr commandrelating to the gh pr commandneeds-triageneeds to be reviewedneeds to be reviewedneeds-user-input