Add support for overriding the github url#3
Conversation
laughedelic
left a comment
There was a problem hiding this comment.
Thanks for the addition, and sorry for the late reply.
See the comment about permissions. I'm going to merge this as is and add my changes on main.
| @@ -1,4 +1,4 @@ | |||
| const githubApiUrl = "https://api.github.com"; | |||
| const githubApiUrl = Deno.env.get("GITHUB_API_URL") ?? "https://api.github.com"; | |||
There was a problem hiding this comment.
This will break existing scripts (if they don't pin the current release version) because doing Deno.env.get requires more permissions. So if this is installed without --allow-env, this line will throw an exception.
I'll try to wrap it into a check whether the script has permissions to access env, so that if it doesn't we can still use the default URL.
There was a problem hiding this comment.
Great point, I was just using -A and hadn't thought about that. Very naughty of me, I'll update my testing procedure.
|
This is now released as https://deno.land/x/github_app_auth@v0.1.3 |
I tested locally with my github-enterprise url and it worked. Not specifying a url will safely fallback to the default without any errors.
Fixes #2