add check for presence of labels

This commit is contained in:
PiquelChips
2025-07-24 19:35:33 +02:00
parent a5bc384d77
commit a0bbf7be23
+3 -1
View File
@@ -443,9 +443,10 @@ export default async function handler(
for (const app of secureApps) { for (const app of secureApps) {
// check for labels // check for labels
if (app?.previewLabels != "") {
const previewLabels = app?.previewLabels?.split(",");
let hasLabel: boolean = false; let hasLabel: boolean = false;
const labels = githubBody?.pull_request?.labels; const labels = githubBody?.pull_request?.labels;
const previewLabels = app?.previewLabels?.split(",");
for (const label of labels) { for (const label of labels) {
if (previewLabels.contains(label.name)) { if (previewLabels.contains(label.name)) {
hasLabel = true; hasLabel = true;
@@ -454,6 +455,7 @@ export default async function handler(
} }
if (hasLabel) if (hasLabel)
continue; continue;
}
const previewLimit = app?.previewLimit || 0; const previewLimit = app?.previewLimit || 0;
if (app?.previewDeployments?.length > previewLimit) { if (app?.previewDeployments?.length > previewLimit) {