You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature or problem you’d like to solve
When merging a PR on GitHub.com, I am able to select which email to use for the commit (if my account has several). I am not able to change this when merging using gh pr merge, instead, it uses the default email.
Proposed solution
An ability to select which email address to use for the merge commit like you can on the web interface. Perhaps as a flag? 🙂
Additional context
N/A
Reacted by Jared Gollhardt, ekans, Przemyslaw Sokol, Tom Spalding and David A
Thank you for the feature request! What you are describing is currently not possible via the GitHub API, so it makes it less likely that we can implement this in a timely manner. In the meantime, I would suggesting merging locally instead, since it's likely you might be in a context of a local git repository.
Wanted to implement this today, but it looks like the GitHub API still doesn't provide any kind of parameter for author emails and names (as mentioned in the comment above).
@jtaylor100 We use the GraphQL API for merging, which supports the AuthorEmail string parameter as input. For those wanting to submit a PR for this, you could add it here
@ekans In #5229 I wanted to also pass the user.name value as you suggest. However it seems that the GraphQL API only has a mutation field for authorEmail, none for something like authorName. So with the current GitHub GraphQL API version, passing the value of user.name is not currently possible.
Activity
mislav commentedon Aug 18, 2020
Thank you for the feature request! What you are describing is currently not possible via the GitHub API, so it makes it less likely that we can implement this in a timely manner. In the meantime, I would suggesting merging locally instead, since it's likely you might be in a context of a local git repository.
mislav commentedon Feb 24, 2021
Adding an idea by @mrolli: the value of
git config user.emailshould be used as the default author email for the merge commit.ekans commentedon May 4, 2021
The value of
git config user.nameshould be used as default author name also. This is the default behavior ofgit merge.mislav commentedon Sep 3, 2021
Examples of other PRs that added extra fields to the
mergePullRequestpayload: #3344 #2980, in case someone wants to add the email field too!jtaylor100 commentedon Feb 14, 2022
Wanted to implement this today, but it looks like the GitHub API still doesn't provide any kind of parameter for author emails and names (as mentioned in the comment above).
See: https://docs.github.com/en/rest/reference/pulls#merge-a-pull-request
Looks like this will remain unresolved until we see some changes from the GitHub REST API. This is closed source, so there's not much more to be done.
mislav commentedon Feb 16, 2022
@jtaylor100 We use the GraphQL API for merging, which supports the
AuthorEmailstring parameter as input. For those wanting to submit a PR for this, you could add it herecli/pkg/cmd/pr/merge/http.go
Lines 54 to 61 in 95b1e7f
jtaylor100 commentedon Feb 20, 2022
@ekans In #5229 I wanted to also pass the
user.namevalue as you suggest. However it seems that the GraphQL API only has a mutation field forauthorEmail, none for something likeauthorName. So with the current GitHub GraphQL API version, passing the value ofuser.nameis not currently possible.