feat(ci): subdomains on the root no underscores

This commit is contained in:
William Harrison
2025-01-10 20:43:05 +08:00
parent 4d91ca3c62
commit 4e04f769f2
9 changed files with 21 additions and 57 deletions
+14
View File
@@ -127,3 +127,17 @@ t("Reserved domains file should be valid", (t) => {
t.pass();
});
const exceptedDomains = require("../util/excepted-domains.json");
t("Subdomains on the root should not start with an underscore", (t) => {
for (const file of files) {
const subdomain = file.replace(/\.json$/, "");
if (subdomain.split(".").length === 1 && !exceptedDomains.includes(subdomain)) {
t.true(subdomain[0] !== "_", `${file}: Root subdomains should not start with an underscore`);
}
}
t.pass();
})