Custom location text for GitHub organization
Asked Answered
J

3

5

How do I set a custom text for the location field of my GitHub organization? Such as the one below:

Under the settings of the organization, I can only find a drop-down menu that lets me select a country.

Jay answered 29/8, 2021 at 7:50 Comment(2)
And github.com/Homebrew shows GitHub as its location, but that isn't a dropdown selection.Intwine
Yep, I guess this feature was removed. An earlier organization that I created had a location which now isn't present in the dropdown. I suppose it was most probably a text field earlier.Jay
M
3

A little late to the game, but this solved my issue!

For organizations:

curl -H "Authorization: bearer GH_PAT_HERE" -d '{"location":"YOUR CUSTOM LOCATION"}' https://api.github.com/orgs/ORG_NAME

Additionally for users:

curl -H "Authorization: bearer GH_PAT_HERE" -d '{"location":"YOUR CUSTOM LOCATION"}' https://api.github.com/user

Credit: https://github.community/t/setting-custom-location-for-github-free-organizations/193506/2

Macropterous answered 21/12, 2021 at 7:33 Comment(2)
If this doesn't work, try removing "bearer". Still didn't work for me, but it did get past the "Bad credentials" error.Lamina
to enhance this answer there is an open discussion to integrate it in the web ui of github : github.com/community/community/discussions/15762Supererogation
L
7

The previous method didn't work for me in 2022, but I found something much simpler.

First, go to your organisation settings.

Next, open DevTools and find the element with ID organization_profile_location. Change its value to whatever you like.

Finally, press "Update profile" to save your changes. Use this method at your own risk, as it is not official.

According to Teddy van Jerry (someone in the comments), this isn't valid for requesting publisher verification.

Lamina answered 24/8, 2022 at 9:42 Comment(2)
Seems to be a neat trickJay
Yep, it works, but that is not valid for requesting publisher verification.Dru
M
3

A little late to the game, but this solved my issue!

For organizations:

curl -H "Authorization: bearer GH_PAT_HERE" -d '{"location":"YOUR CUSTOM LOCATION"}' https://api.github.com/orgs/ORG_NAME

Additionally for users:

curl -H "Authorization: bearer GH_PAT_HERE" -d '{"location":"YOUR CUSTOM LOCATION"}' https://api.github.com/user

Credit: https://github.community/t/setting-custom-location-for-github-free-organizations/193506/2

Macropterous answered 21/12, 2021 at 7:33 Comment(2)
If this doesn't work, try removing "bearer". Still didn't work for me, but it did get past the "Bad credentials" error.Lamina
to enhance this answer there is an open discussion to integrate it in the web ui of github : github.com/community/community/discussions/15762Supererogation
S
0

There is also a way to get the Text Field back.


First, search for this in the DevTools Elements page.

<input class="js-org-location-input-hidden" autocomplete="off" type="hidden" name="organization[profile_location]" id="organization_profile_location">

And replace it with this:

<input class="js-org-location-input-hidden" autocomplete="off" name="organization[profile_location]" id="organization_profile_location">

The result is there will be a text field. How it looks with the text field


Remember, this is glitchy a lot. The dropdown will appear sometimes while typing.

Seminar answered 4/9, 2023 at 14:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.