I’m trying to develop a CLI tool for my organisation. The tool is basically a dev ops utility that creates new repos and applies CI integration to them. So here’s the workflow:
User enters the commands:
$ tool login Username: github-user Password: ******** $ tool create repo-name
So the user would first login via the tool. The login uses Basic user/pass to create an authorization token. This token is persisted on the user’s system so that I’m not requiring their credentials every time they wish to create a repo. The token scope I request is repo so it states that I have read/write access to all repos in the users personal account and organisations.
Then the second command would actually create a repository in the Organisation account. However I’m faced with a permissions error:
403 You need admin access to the organization before adding a repository to it.
This is a little strange because I am the owner of the Organisation. So I try and list all the repos in the Organisation using the authenticated token. Success, I can see every repo (public/private). I went a little further and sent the same request to create a repo in the Organisation but this time using Basic Auth user/pass. Success, it let’s me create a repo in the Organisation.
Why is it that the creating an Organisation repo using an auth token get’s 403?