Update index.js
This commit is contained in:
parent
9d751d74ed
commit
c313ecad8e
1 changed files with 12 additions and 7 deletions
19
index.js
19
index.js
|
@ -21,16 +21,21 @@ async function run() {
|
||||||
newLabels.forEach(async label => {
|
newLabels.forEach(async label => {
|
||||||
let { name, color, description } = label;
|
let { name, color, description } = label;
|
||||||
|
|
||||||
let params = tools.context.repo({
|
|
||||||
name,
|
|
||||||
color,
|
|
||||||
description,
|
|
||||||
headers: { accept: "application/vnd.github.symmetra-preview+json" }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (labels.some(issue => issue.name === name)) {
|
if (labels.some(issue => issue.name === name)) {
|
||||||
|
let params = tools.context.repo({
|
||||||
|
current_name: name,
|
||||||
|
color,
|
||||||
|
description,
|
||||||
|
headers: { accept: "application/vnd.github.symmetra-preview+json" }
|
||||||
|
});
|
||||||
await octokit.issues.updateLabel(params);
|
await octokit.issues.updateLabel(params);
|
||||||
} else {
|
} else {
|
||||||
|
let params = tools.context.repo({
|
||||||
|
name,
|
||||||
|
color,
|
||||||
|
description,
|
||||||
|
headers: { accept: "application/vnd.github.symmetra-preview+json" }
|
||||||
|
});
|
||||||
await octokit.issues.createLabel(params);
|
await octokit.issues.createLabel(params);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue