Skip to content

Commit

Permalink
Update add-labels.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoopy1866 committed Dec 18, 2024
1 parent a20dbb8 commit e9343b6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/scripts/add-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const github = require("@actions/github");

try {
const context = github.context;
const repo = context.repo;
console.log("Repo: ", repo);

if (context.payload.issue) {
const issueTitle = context.payload.issue.title;
Expand All @@ -15,13 +13,13 @@ try {
console.log("Issue Title: ", issueTitle);
console.log("Labels: ", labels);

// if (labels.length > 0) {
// await octokit.rest.issues.addLabels({
// ...github.context.repo,
// issue_number: issueNumber,
// labels: labels,
// });
// }
if (labels.length > 0) {
await octokit.rest.issues.addLabels({
...context.repo,
issue_number: issueNumber,
labels: labels,
});
}
} else {
console.log("This is not an issue event.");
}
Expand Down

0 comments on commit e9343b6

Please sign in to comment.