diff --git a/antd-tools/gulpfile.js b/antd-tools/gulpfile.js index 853f627fa..cdcb512d7 100644 --- a/antd-tools/gulpfile.js +++ b/antd-tools/gulpfile.js @@ -11,7 +11,7 @@ const transformLess = require('./transformLess'); const webpack = require('webpack'); const babel = require('gulp-babel'); const argv = require('minimist')(process.argv.slice(2)); -const GitHub = require('@octokit/rest'); +const { Octokit } = require('@octokit/rest'); const packageJson = require(`${process.cwd()}/package.json`); // const getNpm = require('./getNpm') @@ -168,10 +168,8 @@ function githubRelease(done) { console.log('no changelog found, skip'); return; } - const github = new GitHub(); - github.authenticate({ - type: 'oauth', - token: process.env.GITHUB_TOKEN, + const github = new Octokit({ + auth: process.env.GITHUB_TOKEN, }); const date = new Date(); const { version } = packageJson; @@ -311,10 +309,8 @@ gulp.task( if (!process.env.NPM_TOKEN) { console.log('no NPM token found, skip'); } else { - const github = new GitHub(); - github.authenticate({ - type: 'oauth', - token: process.env.GITHUB_TOKEN, + const github = new Octokit({ + auth: process.env.GITHUB_TOKEN, }); const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line .toString() diff --git a/scripts/syncStyleFromAntd.js b/scripts/syncStyleFromAntd.js index 6ec1019b4..b79d17e9f 100644 --- a/scripts/syncStyleFromAntd.js +++ b/scripts/syncStyleFromAntd.js @@ -1,4 +1,4 @@ -const GitHub = require('@octokit/rest'); +const { Octokit } = require('@octokit/rest'); const Base64 = require('js-base64').Base64; const fs = require('fs'); const fse = require('fs-extra'); @@ -10,7 +10,7 @@ const tag = '3.26.13'; const clientId = '5f6ccfdc4cdc69f8ba12'; const clientSecret = process.env.CLIENT_SECRET; -const github = new GitHub(); +const github = new Octokit(); async function syncFiles(data = []) { for (const item of data) {