From af72181ab947475c710b4f4a96a02dc4d625e517 Mon Sep 17 00:00:00 2001 From: Benjamin Lannon Date: Wed, 12 Dec 2018 19:40:40 -0500 Subject: [PATCH] Adding preview header to get current labels api call --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 7e1de6b..4bfcf3d 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,11 @@ async function run() { } async function getCurrentLabels() { - let response = await octokit.issues.listLabelsForRepo(tools.context.repo()); + let response = await octokit.issues.listLabelsForRepo( + tools.context.repo({ + headers: { accept: "application/vnd.github.symmetra-preview+json" } + }) + ); let data = response.data; return data; @@ -74,8 +78,6 @@ function diffLabels(oldLabels, newLabels) { const oldLabel = oldLabels.filter(l => l.name === oLabel)[0]; const newLabel = newLabels.filter(l => l.name === oLabel)[0]; - console.log({ oldLabel, newLabel }); - if ( oldLabel.color !== newLabel.color || oldLabel.description !== newLabel.description