Skip to content

Commit

Permalink
And then apply the labels
Browse files Browse the repository at this point in the history
  • Loading branch information
John Ouellet committed Oct 13, 2021
1 parent b08df58 commit 8ce48c8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ async function run() {
repo: destRepo,
});

// Create the lables as need be.
let final_labels = [];
for (const [name, color] of Object.entries(labelz_yaml)) {
final_labels.push(name);
if (labels.data.filter(e => e.name === name).length <= 0) {
console.log('test');
console.log(color);
await octokit.rest.issues.createLabel({
owner: origOwner,
repo: destRepo,
Expand All @@ -109,6 +110,14 @@ async function run() {
});
}
}

// And apply the labels.
await octokit.rest.issues.update({
issue_number: transferIssueNumber,
owner: origOwner,
repo: destRepo,
labels: final_labels
});
}

} catch (error) {
Expand Down

0 comments on commit 8ce48c8

Please sign in to comment.