github-script
github-script copied to clipboard
Typing issue with octokit on global github object
Its nice that octokit gets automagically added to the github object but it appears the types don't recognize it.
Property 'rest' does not exist on type 'typeof import("/node_modules/@actions/github/lib/github")'.ts(2339)
Any ideas on how we can fix?
Thanks!
Looks like this works
/**
* @typedef {ReturnType<import('@actions/github').getOctokit>} Octokit
*/
/**
* @typedef {import('@actions/github/lib/context').Context} Context
*/
/**
* @typedef {Object} ExtendedGitHub
* @property {Context} context
*/
/** @type {ExtendedGitHub & Partial<Octokit>} */
const github = require('@actions/github')
const core = require('@actions/core')
But was a pain to setup 😅
Would be nice if the core lib has the corrected types with the injected octokit kits already in place