Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 28, 2024
2 parents f330481 + 96a773b commit 6073bc4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/handlers/pricing-label.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Context } from "../types/context";
import { addLabelToIssue, clearAllPriceLabelsOnIssue, createLabel, listLabelsForRepo } from "../shared/label";

import { addLabelToIssue, clearAllPriceLabelsOnIssue, createLabel, listLabelsForRepo, removeLabelFromIssue } from "../shared/label";
import { labelAccessPermissionsCheck } from "../shared/permissions";
import { Label, UserType } from "../types/github";
import { getPrice } from "../shared/pricing";
Expand Down Expand Up @@ -83,11 +84,19 @@ export async function setPriceLabel(context: Context, issueLabels: Label[], conf
return;
}

for (const timeLabel of recognizedLabels.time) {
}

for (const priorityLabel of recognizedLabels.priority) {
if (priorityLabel.name !== minLabels.time?.name) {
await removeLabelFromIssue(context, priorityLabel.name);
}
}

const targetPriceLabel = getPrice(context, minLabels.time, minLabels.priority);

if (targetPriceLabel) {
await handleTargetPriceLabel(context, targetPriceLabel, labelNames);
} else {
await clearAllPriceLabelsOnIssue(context);
logger.info(`Skipping action...`);
}
Expand Down

0 comments on commit 6073bc4

Please sign in to comment.