Import and Export to GitHub without granting access to Organization's repos


#1

I’d very much like to connect my Glitch projects to GitHub, but it seems to require access to all my Organizations’ public and private repos instead of just my personal ones. Can this be optional since some of the Organizations I’m a part of won’t want to give such access?


#2

Unfortunately the GitHub API didn’t give us the level of granularity that we would like here. To be able to export code to your repos, we need the “repo” permission, which also gives us access to organization repos that you have write access to.


#3

Thanks for the prompt response, @Tim! I’ll go bug GitHub support about that one. I guess in the meantime, I’ll either just code within Glitch or set up a new GitHub account to connect.


#4

For anybody interested in what GitHub support had to say:

There isn’t currently an OAuth scope for selecting specific repositories but not others. We understand that you don’t want to grant applications permissions they don’t need, and these applications probably don’t even want to ask you for these permissions. In some cases, this might even prevent you from using an application.

It’s a very important topic and we’re glad you’re bringing it up with us. Providing more granular OAuth scopes is already the biggest blip on the API team’s radar and it’s something we’d love to do. However, we can’t make promises about if and when the scopes you wished for might be available – the API team is rolling out additional scopes as they are completed.

The best way to keep track of changes is to follow the API blog, and ping us if you have any questions about the available scopes:

https://developer.github.com/changes/

Improving this situation about scopes is something the team has been working on. You might want to check out the recently-announced GitHub Apps (formerly Integrations) feature:

https://developer.github.com/apps/


#5

GitHub Apps allow per-repository access and more finely-grained scopes. If you decide to take a look and give it a try – please post any questions and feedback on the forum (that’s where the team is collecting feedback):

https://platform.github.community/c/integrations

If you have any other thoughts for us about scopes or how the GitHub API could be improved, we’re keen to listen and share them with our team


#6

thanks for following up in here with gh’s response so the rest of the community can know what’s up, patrick!


#7

Hi, I’ve been looking to try and import some of my personal repo’s to Glitch, but my GitHub account is also tied to my employer’s private repo’s, so I can’t do this currently.

Are there any plans to change the import feature to use GitHub’s new ‘Apps’ system that would allow finer grained permissions?


#8

One way to do it is by using the command line (console) I usually never use the Glitch editor unless I’m trying to teach someone how to do something.

Another possibility is by doing it locally and cloning the repo from git into your own device, then adding a remote origin to the API.

This link contains some information on how to copy files from one repo to another.


#10

Nice, thanks for the lead. Slightly different, but I found Using Git to import repo. Not github and worked from your suggestion about the console, etc.

So my steps were:

Ctrl + Shift + X to open the Glitch terminal.
Then pull the public URL for my repo:
git pull https://github.com/my-username/myrepo.git

Which downloads the repository into the Glitch project - might have to fix some conflicts with files like README, so sync the editor:
refresh

Then edit the README or other files with conflicts.
You can use normal git commands in your console like commit, etc.
Just waiting to see if this ‘builds’ now.


#11

Yay, go Glitch - thanks everyone!


#12

You can also use the ‘clone from repo’ option under the New Project menu in the editor, which allows you to import public GitHub repos without granting access permissions.