Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fetch parameter #305

Closed
mmkal opened this issue Oct 25, 2022 · 3 comments · Fixed by #321
Closed

Add fetch parameter #305

mmkal opened this issue Oct 25, 2022 · 3 comments · Fixed by #321
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mmkal
Copy link

mmkal commented Oct 25, 2022

Is your feature request related to a problem? Please describe.

It's often useful to mix-and-match github requests with requests to other services, e.g. the Vercel API, various internal APIs, etc. etc.

Describe the solution you'd like

Provide a fetch argument, just like github, context, core, glob, io, exec etc.

Describe alternatives you've considered

This issue seems to be trying to achieve a similar thing: #272

I also tried using github.request(...) at first, but while you can hit non-GitHub APIs, it's impossible to override the authorization header, for example. If that's an issue, it's one for the octokit repo, though.

Additional context

@octokit/request already depends on node-fetch so by using the same version, it wouldn't even add to the bundled size of this action, I don't think.

I'd be happy to open a PR for this if it would be accepted.

@danmichaelo
Copy link
Contributor

danmichaelo commented Jan 6, 2023

Another alternative would be to upgrade the action to Node 18, which comes with global fetch.

@joshmgross
Copy link
Member

Another alternative would be to upgrade the action to Node 18, which comes with global fetch.

Only Node 12 (deprecated) and Node 16 are supported right now for actions - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing

@joshmgross joshmgross added enhancement New feature or request good first issue Good for newcomers labels Jan 6, 2023
@joshmgross
Copy link
Member

fetch is now available in https://github.com/actions/github-script/releases/tag/v6.4.0

I'll update v6 tomorrow once I've validated that there are no unexpected issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants