@@ -11,7 +11,7 @@ const transformLess = require('./transformLess');
1111const webpack = require ( 'webpack' ) ;
1212const babel = require ( 'gulp-babel' ) ;
1313const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
14- const GitHub = require ( '@octokit/rest' ) ;
14+ const { Octokit } = require ( '@octokit/rest' ) ;
1515
1616const packageJson = require ( `${ process . cwd ( ) } /package.json` ) ;
1717// const getNpm = require('./getNpm')
@@ -168,10 +168,8 @@ function githubRelease(done) {
168168 console . log ( 'no changelog found, skip' ) ;
169169 return ;
170170 }
171- const github = new GitHub ( ) ;
172- github . authenticate ( {
173- type : 'oauth' ,
174- token : process . env . GITHUB_TOKEN ,
171+ const github = new Octokit ( {
172+ auth : process . env . GITHUB_TOKEN ,
175173 } ) ;
176174 const date = new Date ( ) ;
177175 const { version } = packageJson ;
@@ -311,10 +309,8 @@ gulp.task(
311309 if ( ! process . env . NPM_TOKEN ) {
312310 console . log ( 'no NPM token found, skip' ) ;
313311 } else {
314- const github = new GitHub ( ) ;
315- github . authenticate ( {
316- type : 'oauth' ,
317- token : process . env . GITHUB_TOKEN ,
312+ const github = new Octokit ( {
313+ auth : process . env . GITHUB_TOKEN ,
318314 } ) ;
319315 const [ _ , owner , repo ] = execSync ( 'git remote get-url origin' ) // eslint-disable-line
320316 . toString ( )
0 commit comments