mirror of
https://github.com/status-im/status-github-bot.git
synced 2025-02-04 17:33:57 +00:00
Migrate deprecated octokit method calls
This commit is contained in:
parent
3b2436f89b
commit
a0985442c0
@ -188,7 +188,7 @@ async function assignPullRequestToCorrectColumn (context, robot, repo, pullReque
|
||||
robot.log.info(`Would have created card in ${dstColumn.name} column for PR #${prInfo.number}`)
|
||||
} else {
|
||||
// It wasn't in either the source nor the destination columns, let's create a new card for it in the destination column
|
||||
const ghcardPayload = await github.projects.createProjectCard({
|
||||
const ghcardPayload = await github.projects.createCard({
|
||||
column_id: dstColumn.id,
|
||||
content_type: 'PullRequest',
|
||||
content_id: pullRequest.id
|
||||
|
@ -55,7 +55,7 @@ async function assignPullRequestToReview (context, robot) {
|
||||
if (process.env.DRY_RUN) {
|
||||
robot.log.debug(`${botName} - Would have created card`, column.id, payload.pull_request.id)
|
||||
} else {
|
||||
const ghcardPayload = await github.projects.createProjectCard({
|
||||
const ghcardPayload = await github.projects.createCard({
|
||||
column_id: column.id,
|
||||
content_type: 'PullRequest',
|
||||
content_id: payload.pull_request.id
|
||||
|
@ -80,7 +80,7 @@ async function assignIssueToBountyAwaitingForApproval (context, robot, assign) {
|
||||
if (assign) {
|
||||
try {
|
||||
// Create project card for the issue in the bounty-awaiting-approval column
|
||||
const ghcardPayload = await github.projects.createProjectCard({
|
||||
const ghcardPayload = await github.projects.createCard({
|
||||
column_id: column.id,
|
||||
content_type: 'Issue',
|
||||
content_id: payload.issue.id
|
||||
|
@ -70,7 +70,7 @@ async function assignIssueToBountyBug (context, robot, assign) {
|
||||
if (assign) {
|
||||
try {
|
||||
// Create project card for the issue in the bounty-bug column
|
||||
const ghcardPayload = await github.projects.createProjectCard({
|
||||
const ghcardPayload = await github.projects.createCard({
|
||||
column_id: column.id,
|
||||
content_type: 'Issue',
|
||||
content_id: payload.issue.id
|
||||
|
@ -126,7 +126,7 @@ async function getCheckListComment (context) {
|
||||
const owner = context.payload.repository.owner.login
|
||||
const repo = context.payload.repository.name
|
||||
const number = context.payload.pull_request.number
|
||||
const comments = await context.github.paginate(context.github.issues.getComments({ owner, repo, number }), res => res.data)
|
||||
const comments = await context.github.paginate(context.github.issues.listComments({ owner, repo, number }), res => res.data)
|
||||
for (const comment of comments) {
|
||||
const { found } = checkPRChecklist(comment.body)
|
||||
if (found) {
|
||||
|
@ -146,7 +146,7 @@ module.exports = class Stale {
|
||||
if (closeComment) {
|
||||
await this.github.issues.createComment({ owner, repo, number, body: closeComment })
|
||||
}
|
||||
return this.github.issues.edit({ owner, repo, number, state: 'closed' })
|
||||
return this.github.issues.update({ owner, repo, number, state: 'closed' })
|
||||
} else {
|
||||
this.logger.info('%s/%s#%d would have been closed (dry-run)', owner, repo, number)
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ async function processChangedProjectCard (robot, context) {
|
||||
|
||||
let inTestColumn
|
||||
try {
|
||||
const columnPayload = await github.projects.getProjectColumn({ id: payload.project_card.column_id })
|
||||
const columnPayload = await github.projects.getColumn({ column_id: payload.project_card.column_id })
|
||||
|
||||
if (columnPayload.data.name !== testColumnName) {
|
||||
robot.log.trace(`${botName} - Card column name doesn't match watched column name, exiting`, columnPayload.data.name, testColumnName)
|
||||
@ -84,7 +84,7 @@ async function processChangedProjectCard (robot, context) {
|
||||
|
||||
try {
|
||||
const projectId = last(inTestColumn.project_url.split('/'), -1)
|
||||
const projectPayload = await github.projects.getProject({ id: projectId })
|
||||
const projectPayload = await github.projects.get({ project_id: projectId })
|
||||
const project = projectPayload.data
|
||||
if (project.name !== projectBoardName) {
|
||||
robot.log.trace(`${botName} - Project board name doesn't match watched project board, exiting`, project.name, projectBoardName)
|
||||
|
Loading…
x
Reference in New Issue
Block a user