Adding preview header to get current labels api call

This commit is contained in:
Benjamin Lannon 2018-12-12 19:40:40 -05:00
commit af72181ab9

View file

@ -49,7 +49,11 @@ async function run() {
} }
async function getCurrentLabels() { 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; let data = response.data;
return data; return data;
@ -74,8 +78,6 @@ function diffLabels(oldLabels, newLabels) {
const oldLabel = oldLabels.filter(l => l.name === oLabel)[0]; const oldLabel = oldLabels.filter(l => l.name === oLabel)[0];
const newLabel = newLabels.filter(l => l.name === oLabel)[0]; const newLabel = newLabels.filter(l => l.name === oLabel)[0];
console.log({ oldLabel, newLabel });
if ( if (
oldLabel.color !== newLabel.color || oldLabel.color !== newLabel.color ||
oldLabel.description !== newLabel.description oldLabel.description !== newLabel.description