Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting default account email per organization #32

Open
willnorris opened this issue Jun 2, 2016 · 100 comments
Open

Allow setting default account email per organization #32

willnorris opened this issue Jun 2, 2016 · 100 comments

Comments

@willnorris
Copy link
Member

You can set multiple email addresses on your GitHub account, and can route notifications on a per-org basis. However, when you create a commit through github.com (either through the web editor, or merge commits generated by the green merge button), the commit is always authored by the user's default email address (unless of course they have email privacy enabled).

I would like to be able to set the default email so that any changes made in a github.com/google repo always uses my @google.com email. (This is particularly important for us because we want employees to always use their work email address for Google repos)

@bpapa
Copy link

bpapa commented Feb 22, 2018

Would love this because it's broken a key workflow in our org. We're using Xcode server, and the "Big Screen" web view for CI Reports makes it look like we have more team members than we actually do, because some of our commits are from our local machines and some are merges done using the Web UI.

@adam-arold
Copy link

adam-arold commented Apr 18, 2018

Bump. Is there some progress with this? I dont want to have to maintain more than one GitHub profile if I can help it but without this I have to. Is there a solution for this?

@clarkbw
Copy link

clarkbw commented Apr 18, 2018

Hold tight, something is coming

@damienjbyrne
Copy link

Any progress on this? This is a feature I'd really like to have.

@benbalter
Copy link

I would like to be able to set the default email so that any changes made in a github.com/google repo always uses my @google.com email.

Please excuse the lack of update while @clarkbw is away, but just discovered this issue, @willnorris and wanted to point you to https://blog.github.com/changelog/2018-05-03-choose-commit-email/.

As of May, you can choose the email used for web-based commits on the blob editor. It will default to the last email used to commit to the repo, and if you haven't committed before, your org-specific email.

Due to UI complexity and frequency of use, we scoped the feature to just blob edit commits, so merge commits are unaffected at this time and continue to be authored by your primary email.

@adam-arold
Copy link

adam-arold commented Jul 19, 2018

I think for most of us the main point of this feature is to have a separate email for merging pull requests. This is literally true for everyone who has a GitHub account for personal use and wants to use it at the workplace which also uses GitHub.

Having the ability to choose an e-mail for web-based commits is nice I guess, but completely useless for this scenario since I use the web interface both on personal and company projects.

I think the only solution for this problem is an org-based e-mail address separation.

@jackowayed
Copy link

I just wanted to chime in and say that I've built a tool for my organization that is creating and merging PR's via the API, and we have the same issue. It's exacerbating our existing problem with people committing with personal emails from manually merging PR's.

So I hope that when someone takes a look at doing this for PR's, they keep the API in mind. (Or maybe do the API sooner because there isn't the same UI complexity? 😃)

@dipla65
Copy link

dipla65 commented Feb 5, 2019

Hi,
How can i change the content in the email on a timebank application? Is anyone able to help.
Many thanks

@adam-arold
Copy link

adam-arold commented Feb 6, 2019

@clarkbw can you elaborate on that something which is coming? @benbalter any ETA on the fix?

@benbalter
Copy link

@adam-arold I believe @clarkbw may have been referring to https://blog.github.com/changelog/2018-05-03-choose-commit-email/, which solved (I think) the problem @willnorris described initially, at least in terms of web edits.

Building on that, https://github.blog/changelog/2019-01-23-limit-organization-email-notifications-to-verified-domains/ further segments personal and corporate email.

The last remaining step, at least in terms of this thread, would be the ability to choose your merge commit email. While I can't promise a specific date, it's one of our top feature requests, and I'm optimistic it should be implemented in the coming months.

@adam-arold
Copy link

Nice, thanks!

@todogroup todogroup deleted a comment from dipla65 Feb 6, 2019
@todogroup todogroup deleted a comment from dipla65 Feb 6, 2019
@ehartung
Copy link

ehartung commented Feb 7, 2019

@benbalter The feature you mentioned is about setting the commit email address per account, but the issue is about setting a default email address per organisation. This is especially important with GitHub Enterprise Cloud when you can use your account for private development (personal email) and professional work (company email).

@benbalter
Copy link

setting a default email address per organisation.

@ehartung are you able to elaborate? Are you concerned about personal emails being used for notifications? For web commits? For commits pushed via command line? Something else?

@ehartung
Copy link

ehartung commented Feb 7, 2019

@benbalter it's about having my personal email address for merge (web) commits (after PR) for private projects and my company email address for merge commits for business projects (in the GitHub-Org of the company I work for)

@ehartung
Copy link

ehartung commented Feb 7, 2019

... when I talk about "business projects" I mean, non-open-source projects in private repositories (GitHub Enterprise Cloud)

@benbalter
Copy link

it's about having my personal email address for merge (web) commits (after PR) for private projects and my company email address for merge commits for business projects (in the GitHub-Org of the company I work for)

@ehartung thanks for clarifying. Please see my comment above:

The last remaining step, at least in terms of this thread, would be the ability to choose your merge commit email. While I can't promise a specific date, it's one of our top feature requests, and I'm optimistic it should be implemented in the coming months.

As a first pass, we'll allow users to choose any verified email to use for merge commits (as we do for web edits), defaulting to the last email used in the repository, or the organization-specific notification email, if one is set. For most cases, this would default to the corporate email in business projects and their person email in personal projects. The next step would be to allow organization admins to enforce that the corporate email is used for merge commits, which is on our roadmap as a subsequent follow up after the ability to choose the merge commit email.

@ehartung
Copy link

ehartung commented Feb 7, 2019

@benbalter Thanks! Having the ability to choose the email address for merge commits would be great.

@timoreimann
Copy link

I believe isaacs/github#95 is asking for the very same feature.

@ishepherd
Copy link

Ping. Please can you update us on the ETA, @benbalter ?

@numbsafari
Copy link

Will the ability to specify a default account per-organization be something that only applies to the Enterprise cloud, meaning that it's yet another reason not to host an open-source project on github.com, or will it be something that is available for regular github.com organizations?

@benbalter
Copy link

Please can you update us on the ETA

I can't promise an exact timeline for general availability, but for those that are members of the Maintainer's Early Access Program, you should expect access to a private beta within the coming week.

Will the ability to specify a default account per-organization be something that only applies to the Enterprise cloud

Per my comment above, as we do with commits from web edits today, if you have multiple verified emails, you will be presented with the option to choose your merge commit email (on all repos). We'll try to anticipate the email you'd like to use (the default in the dropdown, which you can change), based on your prior commits to the repo, or if this is your first commit, your notification email for the organization, if one is set. This will similarly be available on all repositories.

Building on that, down the line, we might offer organization admins the ability to restrict which emails can be used for merge commits (e.g., requiring an email in the organization's verified domain be used, and only listing those email in the dropdown). That's a bit further down the line, as we wanted to get the ability to choose your merge commit email out first and in your hands, along with several other improvements, and haven't yet decided if the ability to restrict merge commit emails will be limited to organizations on the Enterprise Cloud plan.

@benbalter
Copy link

for those that are members of the Maintainer's Early Access Program, you should expect access to a private beta within the coming week.

If you are a member of the maintainer's early access program, please see https://github.com/maintainers/early-access-feedback/issues/235.

@benbalter
Copy link

Thank you all for your thoughtful feedback. You can now choose the author email for commits created when merging pull requests via the web. For more information, see https://github.blog/changelog/2019-04-24-choose-your-merge-commit-email/.

@LilyMGoh
Copy link

LilyMGoh commented May 1, 2019

@benbalter Is there a way to set the organization default email so that I don't have to select from the dropdown every time? Thanks.

@benbalter
Copy link

Is there a way to set the organization default email so that I don't have to select from the dropdown every time?

@LilyMGoh the drop down will default to the last email you used to commit to the repo, defaulting to your organization notification email if this is your first commit, meaning ideally, it should default to the email you'd like to use for the repo, or will after your first use, without needing to manage an additional setting.

@LilyMGoh
Copy link

LilyMGoh commented May 1, 2019

@benbalter It's a bug then.

@eKoopmans
Copy link

Following up on my earlier comment, I've noticed that there is still an author dropdown when choosing Merge pull request, but not for Squash and merge or Rebase and merge.

So my question is: Why have those two been excluded from selecting the author?

@eKoopmans
Copy link

eKoopmans commented Sep 16, 2022

Not sure if this was announced anywhere, but it looks like the email dropdown is back for squash merges, on both personal and org repos! 🎉 Thanks to whoever was involved in restoring that behaviour!

Edit: The change was announced yesterday on the changelog 😄.

@tarheel
Copy link

tarheel commented Sep 16, 2022

Not sure if this was announced anywhere, but it looks like the email dropdown is back for squash merges, on both personal and org repos! 🎉 Thanks to whoever was involved in restoring that behaviour!

I came upon this thread because I noticed this change recently (within the last few days, I think) and was hoping to find a way to make the dropdown disappear and just automatically use whichever email I've already chosen for the repo in my .git/config. The dropdown does default to the right thing, but I find it distracting that it shows up at all, given that I never want to change it. Apologies if my question is already answered in the long thread above (which I tried to skim), but is there a way to do what I want?

@eKoopmans
Copy link

hoping to find a way to make the dropdown disappear

😭 Oh no! It's been such a hassle not having it!

But I suppose on a user end, it would be possible to remove with a script / browser extension - find the element by CSS query and set its display to none. Seems super unlikely that there would be any GitHub-side setting to hide it though.

@jonnyijapan
Copy link

Clicking in thumb up # 300.

@a-fortunato
Copy link

I came upon this thread because I noticed this change recently (within the last few days, I think) and was hoping to find a way to make the dropdown disappear and just automatically use whichever email I've already chosen for the repo in my .git/config.

In the end, I think this comment is asking the same as the rest of the thread: to automate the email it's being used with a configuration (i.e. by repo, by organisation) instead of having a manual setup.

I came to this thread because I too realised that my automated squash-merge (set from the mobile app) and another squash-merge that a colleague did from my PR (web) both include my personal email instead of the professional one. Then every time I squash-merge a PR I have to remember to set/check the correct email (I'm not sure if it's working that feature where the last email used should appear there, but ofc after the two cases mentioned above, the last email used is the personal one, so I can't trust that it will always be the professional one instead).
Honestly, feels a bit chaotic.

I also vote that it would be great to have some kind of automated selection of the preferred email for an organisation, or at least per repo.

Thanks for the great work on the platform by the way :) I don't usually have concerns with it.

@mattiasJohnson
Copy link

Is the feature to set a commit email per organization when using GH web UI still planned or will it not be added? @benbalter

@lumaxis
Copy link

lumaxis commented Jan 16, 2023

I just read through this entire issue to see which gaps remain in GitHub that we could consider tracking as future improvements. GitHub has evolved quite a bit since this issue was originally opened, for example it is now possible to pick the email on squash and rebase PR merges as mentioned in #32 (comment) and PR suggestions also respect the default author email.

As described in comments here too, the default author email is chosen by:

  1. Looking for the last used email address if the user has previously contributed to the repo
  2. Alternatively using the email configured in custom email notification routing on https://github.com/settings/notifications/custom_routing
  3. Falls back to the primary email configured at https://github.com/settings/emails

Reading for example @a-fortunato's comment, it seems like 1. here might be the most controversial behavior? What are other remaining open gaps that still remain in the product today that you'd like to see addressed?

Looks like 2. is actually no longer true. It appears that this functionality was removed in 2019 due to the feature causing confusion for some users

@mattiasJohnson
Copy link

@lumaxis Do you know if 1. always is true for any operations done through the Github Web UI? If so that would pretty much be good enough for me, I would only have to change the primary email once per repo and although not explicit it would mean being able to set an email per repo.

@gergely-elias
Copy link

gergely-elias commented Mar 6, 2023

I haven't seen this use case mentioned before in this issue, but this seems to affect repositories created from a template owned by an organization.
The author email will be your primary email address even if you have another email set up for that specific organization's notifications.

@mofojed
Copy link

mofojed commented Mar 14, 2023

@lumaxis One part that seems to be missing is setting your primary email address for a given organization or repository. Example:

  • We have a private repository, that only specific members/admins can merge changes into, using the "Squash and Merge" strategy
  • We have contributors in our organization that have configured their email address in the git repository, and then created a PR
  • When the PR is ready to merge, the contributor cannot click the Squash/Merge button, since they do not have permissions. When the admin clicks squash/merge, they do not have the option to select the e-mail address; it automatically uses the contributors primary (personal) email address (which doesn't match the email they set in their git config).

I would expect to use the email address from their git config, or be able to configure a primary email address specific to that repository/organization. I can't seem to find a way to work around it, other than having the contributor change their primary email address (which they shouldn't have to do).

@glenpike
Copy link

glenpike commented Apr 4, 2023

Please can we also have this for the 'Update Branch' button in PR's - they currently seem to default to my main email address, but I need the merge commit to show the one for my org. 🙏

@akshaybhalotia
Copy link

A lot has been said already, just here to add a +1

@DigitalLeaves
Copy link

Adding my 👍

@xsurfer
Copy link

xsurfer commented Dec 1, 2023

+1

@berislavlopac
Copy link

As a bare minimum, I would like to see the option to choose which email address to use for notifications about an organization's repos. E.g. if I'm invited to review a PR on such a repo, I want to be notified at the organization email.

@disasmwinnie
Copy link

disasmwinnie commented Mar 13, 2024

Any feedback from GH whether this is even considered as a feature?

Leaking customer data via notifications to private mail-address is currently a blocker. Have to force people to use a second account.

@kadazuro
Copy link

hi there, under Settings->Notifications there seems to be a way to do this already, by clicking the custom routing button next to the email.
I was able to setup a custom routing from the repos of an organizations to a specific email (previously registered)
I haven't test it out just yet, but the option is there, fingers crossed.

@disasmwinnie
Copy link

@kadazuro exactly what I was searching for. Thanks for the tip!

@berislavlopac
Copy link

Oh you're right @kadazuro , I completely missed that. Thank you!

@glenpike
Copy link

hi there, under Settings->Notifications there seems to be a way to do this already, by clicking the custom routing button next to the email. I was able to setup a custom routing from the repos of an organizations to a specific email (previously registered) I haven't test it out just yet, but the option is there, fingers crossed.

This doesn't change the default email for PRs it seems - I set the notification email for my organisation, but for each new Repository I work on, it seems I have to change the email on PRs when merging.

@dannysauer
Copy link

Building on that, down the line, we might offer organization admins the ability to restrict which emails can be used for merge commits (e.g., requiring an email in the organization's verified domain be used, and only listing those email in the dropdown). That's a bit further down the line, as we wanted to get the ability to choose your merge commit email out first and in your hands, along with several other improvements, and haven't yet decided if the ability to restrict merge commit emails will be limited to organizations on the Enterprise Cloud plan.

Are we close to being down the line yet, @benbalter? :) As an org admin for multiple orgs, I'm looking for a way to bring some consistency to our repos (some OSS, some private). One place that needs work is enforcing that users squash-merge to main (or wherever) with their work email address. They consistently commit as user@work, thanks to a bot verifying the email addresses, but I haven't found a good way to either make their work email address the default or reject attempts to squash-merge PRs using the wrong email address. I can of course ask everyone to make sure the default is set per repo or make their work email address the primary, but the former is tedious and annoying (make a laceholder commit via the web UI?) and the latter is not really something everyone will buy in to, since the majority of developers also work on private projects, etc. And either way, I'd have to add a procedure to remind every new hire of the setting, write some auditing scripts, etc.

As a devops person working with a whole bunch of repos, I also would like this feature to make my own work easier. :D

@dubhunter
Copy link

This is still an issue @benbalter. I created a "Revert" PR through the Web UI, and it had my Primary email. Not my Org email. Can GH just allow per-repo or per-org email settings? This is super frustrating.

@mikeweilgart
Copy link

So, still not possible to set the default email address to use for PR commit messages on an organization-wide basis?

I'm dealing with dozens and dozens of repos in this organization; having the correct email address only remembered on a per-repo basis is effectively the same as not remembering it at all, since I'll have to maintain constant vigilance anyway to avoid putting my personal email address in the organization's commit history.

I have to agree with this comment from community discussions:

The de facto workaround for this is to have all everyone create a new GitHub account specifically for each organization, which is inconvenient and undermines GitHub's goal of individuals having one account. I'd love to be able to advocate for individuals only having one GitHub account, but until this is resolved I'm inclined to recommend that every company makes employees create a GitHub account specifically for work.

@XedinUnknown
Copy link

I was able to set up custom routing based on an organization, as explained here. Whether or not it worked - remains to be determined.

@ArcanisCz
Copy link

ArcanisCz commented Sep 6, 2024

I second this 100%, I am part of 2 organizations and I am breaking some policy constantly by accidentally using wrong email... this is totally business breaking for big companies.

Please note, I have custom routing set - it ONLY AFFECTS NOTIFICATIONS, nothing else.

Also, there are some places where I seem to even cannot be selecting my email.

Updating branch with main branch

image

Clicking on automerge (merge when ready)

image

@Strernd
Copy link

Strernd commented Oct 7, 2024

Would have expected a fix for this after 9 years, but here I am once again, having this problem.

@skiz
Copy link

skiz commented Oct 24, 2024

Here I am looking around for the expected setting for an org based preferred email and find this is still open years later.

What is the gist of of the last 9 years of progress on this? It's unprofessional and unexpected behavior to have your personal email be plastered on a merge using the UI.

@rpggio
Copy link

rpggio commented Oct 25, 2024

Looks like I'll have to use 'Keep my email addresses private' for web actions. Then the question is whether to use the same no-reply address in git config for sake of consistency. I'm leaning that way - It's not like people won't be able to locate me without an email address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests