github.request()
should respect custom headers like Accept
, Authorization
etc.
#272
Labels
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
I'd like to make custom, external request with custom headers for fetching data using
github.request()
in my github-script.However, the method is ignoring custom HTTP headers provided in it's options like
Accept
andAuthorization
- I didn't check any othersUser-agent
might also be the case.Describe the solution you'd like
Script like this:
Could respect given headers in the request options.
It would be a really nice way of fetching data in github-script without usage of additional steps/libs/dependencies.
Describe alternatives you've considered
Using bash step with
curl
orexec.exec('curl');
in github-script step, but both feel clunky in this case. Installing node deps likenode-fetch
seems like a waste of time and resources, especially whengithub.request()
is using exactlynode-fetch
under the hood, but we just can't access it.Additional context
https://stackoverflow.com/questions/72815672/cant-override-some-http-headers-with-github-request-in-actions-github-script
The text was updated successfully, but these errors were encountered: