add check for presence of labels

This commit is contained in:
PiquelChips
2025-07-24 19:35:33 +02:00
parent a5bc384d77
commit a0bbf7be23

View File

@@ -443,17 +443,19 @@ export default async function handler(
for (const app of secureApps) {
// check for labels
let hasLabel: boolean = false;
const labels = githubBody?.pull_request?.labels;
const previewLabels = app?.previewLabels?.split(",");
for (const label of labels) {
if (previewLabels.contains(label.name)) {
hasLabel = true;
break;
if (app?.previewLabels != "") {
const previewLabels = app?.previewLabels?.split(",");
let hasLabel: boolean = false;
const labels = githubBody?.pull_request?.labels;
for (const label of labels) {
if (previewLabels.contains(label.name)) {
hasLabel = true;
break;
}
}
}
if (hasLabel)
continue;
if (hasLabel)
continue;
}
const previewLimit = app?.previewLimit || 0;
if (app?.previewDeployments?.length > previewLimit) {