Skip to content

Commit 527d544

Browse files
committed
⬆️ Update deprecated octokit methods
1 parent 6cc7639 commit 527d544

2 files changed

Lines changed: 80 additions & 80 deletions

File tree

‎lib/pull.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = class Pull {
132132
per_page: 1
133133
})
134134
if (res.data.total_count > 0) {
135-
const pr = await this.github.pullRequests.get({
135+
const pr = await this.github.pulls.get({
136136
owner: this.config.owner,
137137
repo: this.config.repo,
138138
number: res.data.items[0].number
@@ -144,7 +144,7 @@ module.exports = class Pull {
144144

145145
async createPR (base, upstream, assignees, reviewers) {
146146
try {
147-
const createdPR = await this.github.pullRequests.create({
147+
const createdPR = await this.github.pulls.create({
148148
owner: this.config.owner,
149149
repo: this.config.repo,
150150
head: upstream,
@@ -179,7 +179,7 @@ module.exports = class Pull {
179179
const maxRetries = config.maxRetries || 5
180180
let i = 0
181181
while (i++ < maxRetries) {
182-
const createdPR = await this.github.pullRequests.get({
182+
const createdPR = await this.github.pulls.get({
183183
owner: this.config.owner,
184184
repo: this.config.repo,
185185
number
@@ -200,7 +200,7 @@ module.exports = class Pull {
200200

201201
async addReviewers (prNumber, reviewers) {
202202
if (!prNumber || !reviewers || reviewers.length === 0) return null
203-
return this.github.pullRequests.createReviewRequest({
203+
return this.github.pulls.createReviewRequest({
204204
owner: this.config.owner,
205205
repo: this.config.repo,
206206
number: prNumber,
@@ -210,7 +210,7 @@ module.exports = class Pull {
210210

211211
async mergePR (number, merge_method = 'merge') {
212212
if (!number) return null
213-
return this.github.pullRequests.merge({
213+
return this.github.pulls.merge({
214214
owner: this.config.owner,
215215
repo: this.config.repo,
216216
merge_method,
@@ -220,7 +220,7 @@ module.exports = class Pull {
220220

221221
async hardResetCommit (baseRef, sha) {
222222
if (!baseRef || !sha) return null
223-
return this.github.gitdata.updateRef({
223+
return this.github.git.updateRef({
224224
owner: this.config.owner,
225225
repo: this.config.repo,
226226
ref: `heads/${baseRef}`,

0 commit comments

Comments
 (0)