8000 fix(package): update @octokit/rest to version 16.13.1 · coderbyheart/github@4c756b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c756b2

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
fix(package): update @octokit/rest to version 16.13.1
1 parent 2b5e557 commit 4c756b2

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

lib/find-sr-issues.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {ISSUE_ID} = require('./definitions/constants');
33
module.exports = async (github, title, owner, repo) => {
44
const {
55
data: {items: issues},
6-
} = await github.search.issues({
6+
} = await github.search.issuesAndPullRequests({
77
q: `in:title+repo:${owner}/${repo}+type:issue+state:open+${title}`,
88
});
99

lib/get-client.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ module.exports = ({githubToken, githubUrl, githubApiPathPrefix, proxy}) => {
3131
const baseUrl = githubUrl && urljoin(githubUrl, githubApiPathPrefix);
3232
const globalThrottler = new Bottleneck({minTime: GLOBAL_RATE_LIMIT});
3333
const github = new Octokit({
34+
auth: `token ${githubToken}`,
3435
baseUrl,
35-
agent: proxy
36-
? baseUrl && url.parse(baseUrl).protocol.replace(':', '') === 'http'
37-
? new HttpProxyAgent(proxy)
38-
: new HttpsProxyAgent(proxy)
39-
: undefined,
36+
request: {
37+
agent: proxy
38+
? baseUrl && url.parse(baseUrl).protocol.replace(':', '') === 'http'
39+
? new HttpProxyAgent(proxy)
40+
: new HttpsProxyAgent(proxy)
41+
: undefined,
42+
},
4043
});
4144

4245
github.hook.wrap('request', (request, options) => {
@@ -56,7 +59,5 @@ module.exports = ({githubToken, githubUrl, githubApiPathPrefix, proxy}) => {
5659
}, RETRY_CONF);
5760
});
5861

59-
github.authenticate({type: 'token', token: githubToken});
60-
6162
return github;
6263
};

lib/success.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = async (pluginConfig, context) => {
4444
const shas = commits.map(({hash}) => hash);
4545

4646
const searchQueries = getSearchQueries(`repo:${owner}/${repo}+type:pr+is:merged`, shas).map(
47-
async q => (await github.search.issues({q})).data.items
47+
async q => (await github.search.issuesAndPullRequests({q})).data.items
4848
);
4949

5050
const prs = await pFilter(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"Gregor Martynus (https://twitter.com/gr2m)"
1717
],
1818
"dependencies": {
19-
"@octokit/rest": "^16.0.1",
19+
"@octokit/rest": "^16.13.1",
2020
"@semantic-release/error": "^2.2.0",
2121
"aggregate-error": "^2.0.0",
2222
"bottleneck": "^2.0.1",

test/get-client.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ test('Use the global throttler for all endpoints', async t => {
100100
const b = await github.issues.createComment();
101101
const c = await github.repos.createRelease();
102102
const d = await github.issues.createComment();
103-
const e = await github.search.issues();
104-
const f = await github.search.issues();
103+
const e = await github.search.issuesAndPullRequests();
104+
const f = await github.search.issuesAndPullRequests();
105105

106106
// `issues.createComment` should be called `rate` ms after `repos.createRelease`
107107
t.true(inRange(b - a, rate - 50, rate + 50));
108108
// `repos.createRelease` should be called `rate` ms after `issues.createComment`
109109
t.true(inRange(c - b, rate - 50, rate + 50));
110110
// `issues.createComment` should be called `rate` ms after `repos.createRelease`
111111
t.true(inRange(d - c, rate - 50, rate + 50));
112-
// `search.issues` should be called `rate` ms after `issues.createComment`
112+
// `search.issuesAndPullRequests` should be called `rate` ms after `issues.createComment`
113113
t.true(inRange(e - d, rate - 50, rate + 50));
114-
// `search.issues` should be called `rate` ms after `search.issues`
114+
// `search.issuesAndPullRequests` should be called `rate` ms after `search.issuesAndPullRequests`
115115
t.true(inRange(f - e, rate - 50, rate + 50));
116116
});
117117

@@ -130,8 +130,8 @@ test('Use the same throttler for endpoints in the same rate limit group', async
130130
const b = await github.issues.createComment();
131131
const c = await github.repos.createRelease();
132132
const d = await github.issues.createComment();
133-
const e = await github.search.issues();
134-
const f = await github.search.issues();
133+
const e = await github.search.issuesAndPullRequests();
134+
const f = await github.search.issuesAndPullRequests();
135135

136136
// `issues.createComment` should be called `coreRate` ms after `repos.createRelease`
137137
t.true(inRange(b - a, coreRate - 50, coreRate + 50));

0 commit comments

Comments
 (0)
0