@@ -11,7 +11,7 @@ const transformLess = require('./transformLess');
11
11
const webpack = require ( 'webpack' ) ;
12
12
const babel = require ( 'gulp-babel' ) ;
13
13
const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
14
- const GitHub = require ( '@octokit/rest' ) ;
14
+ const { Octokit } = require ( '@octokit/rest' ) ;
15
15
16
16
const packageJson = require ( `${ process . cwd ( ) } /package.json` ) ;
17
17
// const getNpm = require('./getNpm')
@@ -168,10 +168,8 @@ function githubRelease(done) {
168
168
console . log ( 'no changelog found, skip' ) ;
169
169
return ;
170
170
}
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 ,
175
173
} ) ;
176
174
const date = new Date ( ) ;
177
175
const { version } = packageJson ;
@@ -311,10 +309,8 @@ gulp.task(
311
309
if ( ! process . env . NPM_TOKEN ) {
312
310
console . log ( 'no NPM token found, skip' ) ;
313
311
} 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 ,
318
314
} ) ;
319
315
const [ _ , owner , repo ] = execSync ( 'git remote get-url origin' ) // eslint-disable-line
320
316
. toString ( )
0 commit comments