Skip to content

TypeScript definitions for GitHub of @actions/github broken #365

@LukasBombach

Description

@LukasBombach

Describe the bug
The TypeScript definitions for GitHub of @actions/github are almost entirely wrong. They export a class with a single public method called graphql the takes an object of options.

This does not reflect the documentation or the actual library at all.

The documentation says you can do the following things:

import { GitHub } from "@actions/github"
const octokit = new github.GitHub(myToken);

octokit.pulls.get(/* ... */);
octokit.issues.create(/* ... */);
octokit.graphql(query, variables);

Instead TypeScript says the octokit only has a single method called graphql expecting a single parameter only.

To Reproduce

  1. yarn init -y
  2. yarn add @actions/github
  3. touch index.ts
  4. open index.ts add the following code
    import { GitHub } from "@actions/github"
    
    const x: any = null;
    
    const octokit = new github.GitHub(x);
    
    octokit.pulls.get(x);
    octokit.issues.create(x);
    octokit.graphql(x, x);

Expected behavior
TypeScript will reflect the API of the library and match the documentation

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browser Node.js
  • Version 12 lts

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions