Merge pull request #21758 from is-a-dev/wdhdev-patch-1

feat(ci): root subdomains must have atleast one usable record
This commit is contained in:
William Harrison
2025-04-04 14:38:43 +08:00
committed by GitHub
+21 -1
View File
@@ -216,7 +216,10 @@ function validateRecordValues(t, data, file) {
Number.isInteger(record.matchingType) && record.matchingType >= 0 && record.matchingType <= 255,
`${file}: Invalid matchingType for ${key} at index ${idx}`
);
t.true(isValidHexadecimal(record.certificate), `${file}: Invalid certificate for ${key} at index ${idx}`);
t.true(
isValidHexadecimal(record.certificate),
`${file}: Invalid certificate for ${key} at index ${idx}`
);
}
});
}
@@ -310,3 +313,20 @@ t("All files should have valid record types", (t) => {
t.pass();
});
t("Root subdomains should have at least one usable record", (t) => {
const usableRecordTypes = ["A", "AAAA", "CNAME", "MX", "NS", "URL"];
files.forEach((file) => {
const subdomain = file.replace(/\.json$/, "");
if (subdomain.includes(".") || subdomain.startsWith("_")) return;
const data = getDomainData(file);
const recordKeys = Object.keys(data.record);
t.true(
usableRecordTypes.some((record) => recordKeys.includes(record)),
`${file}: Root subdomains must have at least one A, AAAA, CNAME, MX, NS, or URL record`
);
});
});