Skip to content

Commit

Permalink
fix: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
BeanieMen committed Feb 7, 2024
1 parent 476d671 commit add9984
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async function main() {
}
continue;
}
// If devpool issue has the "Unavailable" label then close such issue
if ((devpoolIssue.labels as GitHubLabel[]).some((label) => label.name.includes(LABELS.UNAVAILABLE))) {
// If project issue is assigned then close the devpool equivalent
if (projectIssue.assignee?.login) {
if (devpoolIssue.state === "open") {
await octokit.rest.issues.update({
owner: DEVPOOL_OWNER_NAME,
Expand All @@ -110,9 +110,7 @@ async function main() {
state: "open",
});
console.log(`Opened (bounty available): ${devpoolIssue.html_url} (${projectIssue.html_url})`);
} else {
console.log(`Already opened (bounty available): ${devpoolIssue.html_url} (${projectIssue.html_url})`);
}
} else continue;
}
// prepare for issue updating
const isDevpoolUnavailableLabel = (devpoolIssue.labels as GitHubLabel[])?.some((label) => label.name === LABELS.UNAVAILABLE);
Expand Down Expand Up @@ -154,7 +152,7 @@ async function main() {
if (projectIssue.state === "closed") continue;
// if issue doesn't have the "Price" label then skip it, no need to pollute repo with draft issues
if (!(projectIssue.labels as GitHubLabel[]).some((label) => label.name.includes(LABELS.PRICE))) continue;
if (projectIssue.assignee) continue;
if (projectIssue.assignee?.login) continue;

// create a new issue
const createdIssue = await octokit.rest.issues.create({
Expand Down

0 comments on commit add9984

Please sign in to comment.