|
1 | 1 | import fs from 'node:fs'; |
2 | 2 |
|
3 | 3 | import chalk from 'chalk'; |
4 | | -import Octokit from '@octokit/rest'; |
| 4 | +import { Octokit } from '@octokit/rest'; |
5 | 5 |
|
6 | 6 | import { logDown, logUp, log } from '../util/log.js'; |
7 | 7 | import { getCache, setCache, removeCache } from './cache.js'; |
8 | 8 | import { getCNAMEsFile, validateCNAMEs } from './cnames.js'; |
9 | 9 | import { parseCNAMEsFile } from '../util/cnames.js'; |
10 | 10 | import { repoContactIssue } from './templates.js'; |
11 | | -import config from '../../config.json' assert { type: 'json' }; |
| 11 | +import confirm from './confirm.js'; |
| 12 | +import config from '../../config.json' with { type: 'json' }; |
12 | 13 |
|
13 | 14 | const octokit = new Octokit({ auth: config.github_token }); |
14 | 15 |
|
@@ -76,7 +77,7 @@ const attemptTargetIssues = async (failed, issueUrl) => { |
76 | 77 | // Attempt to create issue |
77 | 78 | let issue; |
78 | 79 | try { |
79 | | - issue = await octokit.issues.create({ |
| 80 | + issue = await octokit.rest.issues.create({ |
80 | 81 | owner, |
81 | 82 | repo, |
82 | 83 | title: 'JS.ORG CLEANUP', |
@@ -210,7 +211,7 @@ export const createMainIssue = async () => { |
210 | 211 | // Create new empty issue (change this for DEV) |
211 | 212 | let issue = getCache('createMainIssueProgress'); |
212 | 213 | if (!issue) { |
213 | | - issue = await octokit.issues.create({ |
| 214 | + issue = await octokit.rest.issues.create({ |
214 | 215 | owner: config.repository_owner, |
215 | 216 | repo: config.repository_name, |
216 | 217 | title: 'JS.ORG CLEANUP', |
@@ -252,7 +253,7 @@ export const createMainIssue = async () => { |
252 | 253 | .replace(/{{CONTACT_ISSUE}}/g, contactIssue); |
253 | 254 |
|
254 | 255 | // Edit the issue |
255 | | - await octokit.issues.update({ |
| 256 | + await octokit.rest.issues.update({ |
256 | 257 | owner: config.repository_owner, |
257 | 258 | repo: config.repository_name, |
258 | 259 | issue_number: issue.data.number, |
@@ -291,7 +292,7 @@ export const parseIssueEntries = async issueNumber => { |
291 | 292 | } |
292 | 293 |
|
293 | 294 | // Get the issue body |
294 | | - const issue = await octokit.issues.get({ |
| 295 | + const issue = await octokit.rest.issues.get({ |
295 | 296 | owner: config.repository_owner, |
296 | 297 | repo: config.repository_name, |
297 | 298 | issue_number: issueNumber |
|
0 commit comments