feat: preview deployments for pull requests with specific labels

This commit is contained in:
PiquelChips
2025-07-23 21:39:54 +02:00
parent b95dfed8fc
commit f2ae39aa86
3 changed files with 31 additions and 0 deletions

View File

@@ -442,6 +442,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 (hasLabel)
continue;
const previewLimit = app?.previewLimit || 0;
if (app?.previewDeployments?.length > previewLimit) {
continue;