actions / actions/toolkit

Typings always return "never" for Octokit calls from @actions/github

Open
#973 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I've reused code from the readme to try a few things and the return value for all calls to octokit.rest.X is always never.

To Reproduce
Steps to reproduce the behavior:

  1. Create an index.ts file with the default usage from https://github.com/actions/toolkit/tree/main/packages/github#usage
  2. Replace require statement with imports if needed
  3. Notice TS errors because pull_request is typed never.

Expected behavior
Return value should be properly set

Screenshots
image

Notice the return value from get is Promise<never>. All calls return the same thing, issues, checks, etc..

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the default usage in the packages/github README and reproduce the issue in an index.ts file using the documented imports. Inspect why octokit.rest calls such as pull_request.get are inferred as Promise; done means the calls expose their proper return types and the reproduction no longer produces TypeScript errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.