Skip to content

Commit

Permalink
fix(github): use non-deprecated requestReviewers function (#978)
Browse files Browse the repository at this point in the history
Instead of createReviewRequest, requestReviewers is used.

See: https://octokit.github.io/rest.js/v18/#pulls-request-reviewers and octokit/octokit.js#1760
  • Loading branch information
Haroenv committed Apr 5, 2022
1 parent db7a3f2 commit be87a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('createPullRequest', () => {
data: { number: 13, html_url: 'https://github.com/my/repo/pull/13' }, // eslint-disable-line camelcase
}));
Octokit.mockImplementationOnce(function () {
this.pulls = { create, createReviewRequest: jest.fn() };
this.pulls = { create, requestReviewers: jest.fn() };
});
const { pullRequestUrl } = await createPullRequest(getDefaultParams());
expect(pullRequestUrl).toEqual('https://github.com/my/repo/pull/13');
Expand Down
2 changes: 1 addition & 1 deletion packages/shipjs/src/step/prepare/createPullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default async ({
(pullRequestReviewers || []).length > 0 ||
(pullRequestTeamReviewers || []).length > 0
) {
await octokit.pulls.createReviewRequest({
await octokit.pulls.requestReviewers({
owner,
repo,
pull_number: number, // eslint-disable-line camelcase
Expand Down

0 comments on commit be87a2c

Please sign in to comment.