Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Use `.rest` in Octokit calls (#3506)
Dhruv Bhanushali8b0ec498e12d
diff --git a/automations/js/src/label_pr.mjs b/automations/js/src/label_pr.mjsindex 126f27b94..8d09bdf22 100644--- a/automations/js/src/label_pr.mjs+++ b/automations/js/src/label_pr.mjs@@ -36,7 +36,7 @@ function getIsFullyLabeled(labels) {*/async function getLabel(octokit, repository, name) {const [owner, repo] = repository.split('/')- const res = await octokit.issues.getLabel({ owner, repo, name })+ const res = await octokit.rest.issues.getLabel({ owner, repo, name })return {id: res.data.node_id,name,diff --git a/automations/js/src/sync_labels.mjs b/automations/js/src/sync_labels.mjsindex 613f902a1..c04bbbe15 100644--- a/automations/js/src/sync_labels.mjs+++ b/automations/js/src/sync_labels.mjs@@ -48,7 +48,7 @@ export const main = async (octokit, core) => {// We assume that both repos have < 100 labels and do not paginate./** @type {Label[]} */- const { data: monoLabels } = await octokit.issues.listLabelsForRepo({+ const { data: monoLabels } = await octokit.rest.issues.listLabelsForRepo({...monoRepo,per_page: 100,})@@ -56,7 +56,7 @@ export const main = async (octokit, core) => {core.info(`Found ${monoLabels.length} labels in the monorepo.`)/** @type {Label[]} */- const { data: infraLabels } = await octokit.issues.listLabelsForRepo({+ const { data: infraLabels } = await octokit.rest.issues.listLabelsForRepo({...infraRepo,per_page: 100,})@@ -87,11 +87,11 @@ export const main = async (octokit, core) => {if (diff.length) {const diffs = diff.join(', ')core.info(`Label "${label.name}" differs in ${diffs}. Updating.`)- await octokit.issues.updateLabel(newLabel)+ await octokit.rest.issues.updateLabel(newLabel)}} else {core.info(`Label "${label.name}" does not exist. Creating.`)- await octokit.issues.createLabel(newLabel)+ await octokit.rest.issues.createLabel(newLabel)}}}