Skip to content

Commit 503d358

Browse files
committed
chore: update octokit/rest
1 parent dd5df85 commit 503d358

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

antd-tools/gulpfile.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const transformLess = require('./transformLess');
1111
const webpack = require('webpack');
1212
const babel = require('gulp-babel');
1313
const argv = require('minimist')(process.argv.slice(2));
14-
const GitHub = require('@octokit/rest');
14+
const { Octokit } = require('@octokit/rest');
1515

1616
const 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()

scripts/syncStyleFromAntd.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const GitHub = require('@octokit/rest');
1+
const { Octokit } = require('@octokit/rest');
22
const Base64 = require('js-base64').Base64;
33
const fs = require('fs');
44
const fse = require('fs-extra');
@@ -10,7 +10,7 @@ const tag = '3.26.13';
1010
const clientId = '5f6ccfdc4cdc69f8ba12';
1111
const clientSecret = process.env.CLIENT_SECRET;
1212

13-
const github = new GitHub();
13+
const github = new Octokit();
1414

1515
async function syncFiles(data = []) {
1616
for (const item of data) {

0 commit comments

Comments
 (0)