rcbops / gh2

A tool to transmogrify GitHub issues to any desired output
Other
3 stars 4 forks source link

How to make it work for Github Enterprise? #14

Open Vic3Q opened 7 years ago

Vic3Q commented 7 years ago

I find this script very useful but I need to make it work for Github Enterprise. I changed the address in github3 but I still get 401 Bad Credentials. I've set up GITHUB_TOKEN correctly.

Vic3Q commented 7 years ago

Something odd - I have changed all to my private Github and reverted the changes in py files where it required different address but I still get "Bad Credentials", so it's not a problem with address but something else.

Vic3Q commented 7 years ago

Another update - I have checked regular curl query but changed it to use GITHUB_TOKEN to make sure it's valid. Query looked like this:

curl -u user:%GITHUB_TOKEN% -i https://blablabla

It worked as expected, so variable is set correctly.

Vic3Q commented 7 years ago

I got info that github3.py you're using already has GitHubEnterprise access implemented, but I'm not sure how to make gh2 use that: https://github.com/sigmavirus24/github3.py/blob/develop/github3/github.py#L1679

I thought it might be like this, changing below line: https://github.com/rcbops/gh2/blob/master/gh2/csv.py#L68 to this: gh = github3.GitHubEnterprise(url='https://github.ibm.com', token=token)

but it didn't work as expected. I'm no perl dev so I have almost no idea what am I doing.