github-app-token icon indicating copy to clipboard operation
github-app-token copied to clipboard

Action does not work behind a proxy - creating installation access token

Open abebehailu opened this issue 2 years ago • 3 comments

Issue: The part of the action that creates installation token does not work behind a proxy.

Reason: That part uses the @Octokit/request library to make a request to the access_token endpoint. That library in turn uses the library noda-fetch without sending in any proxy agent. The noda-fetch library does not check for http_proxy environment variables (https://github.com/node-fetch/node-fetch/issues/195).

The call that fetches repo installation uses Octokit from the @actions/github library, which supports running behind a proxy.

Fix: Use @actions/github also for creating access token.

I have a simple fix for this but I need write access to be able to contribute.

abebehailu avatar Aug 26 '22 07:08 abebehailu

ping @tibdex

abebehailu avatar Aug 26 '22 07:08 abebehailu

@abebehailu, do you have a fork with the fix?

sadovnikov avatar Sep 22 '22 11:09 sadovnikov

@sadovnikov Yes, here https://github.com/abebehailu/github-app-token. The octokit rest api from @actions/github uses the set proxy enviornment variables. Feel free to test it out from my fork.

abebehailu avatar Sep 30 '22 11:09 abebehailu

@tibdex can you deploy the latest version to Github marketplace?

abebehailu avatar Oct 18 '22 12:10 abebehailu

Done ;)

tibdex avatar Oct 18 '22 13:10 tibdex