Adding preview header to get current labels api call
This commit is contained in:
parent
8da24fba11
commit
af72181ab9
1 changed files with 5 additions and 3 deletions
8
index.js
8
index.js
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue