Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

octokit.issues.create didn't work for me. Error Cannot read property 'create' of undefined #36

Open
boanders74 opened this issue Jun 17, 2021 · 3 comments

Comments

@boanders74
Copy link

The lesson says to use this code
const github = require("@actions/github");
const octokit = new github.getOctokit(token);
const newIssue = await octokit.issues.create({

but the create seemed to always fail with this error below.

image

I found online someone that used this and that seemed to work for me
const newIssue = await octokit.rest.issues.create({

@markpatterson27
Copy link
Contributor

I had this issue too. v5.0.0 of @actions/github seems to have added .rest to the method call. (presumably this is due to a change in octokit/rest.js, but I didn't look that up)

@gessnersn
Copy link
Contributor

+1 stumbled into the same issue today

@jckling
Copy link

jckling commented Apr 1, 2022

Same problem, have to add .rest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants