Adding production grade

This commit is contained in:
Moritz Graf
2026-04-25 13:43:01 +02:00
parent 37337ffb13
commit d7c89fda4e
5 changed files with 19 additions and 27 deletions
+6 -3
View File
@@ -20,6 +20,9 @@ const CONFIG = {
// The admin email that should receive the execution reports
ADMIN_EMAIL: "moritz@haumdaucher.de",
// The primary Workspace domain for validation and auto-appending
WORKSPACE_DOMAIN: "haumdaucher.de",
// Dry run mode. If true, the script will only log what it would do and send the email,
// but will NOT actually create, update, or delete any groups in Workspace.
DRY_RUN: true,
@@ -145,12 +148,12 @@ function readDesiredStateFromSheet() {
// 1. Auto-append domain to source if they just typed a name (e.g. "frederic")
if (source && !source.includes("@")) {
source += "@haumdaucher.de";
source += `@${CONFIG.WORKSPACE_DOMAIN}`;
}
// 2. Validate source domain
if (source && !source.endsWith("@haumdaucher.de")) {
console.warn(`Row ${i + 1}: Skipped. Source address must belong to @haumdaucher.de domain. Found: '${source}'`);
if (source && !source.endsWith(`@${CONFIG.WORKSPACE_DOMAIN}`)) {
console.warn(`Row ${i + 1}: Skipped. Source address must belong to @${CONFIG.WORKSPACE_DOMAIN} domain. Found: '${source}'`);
continue;
}