mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-05-20 20:24:49 +00:00
feat(ci): root subdomains must have atleast one usable record
This commit is contained in:
+20
-1
@@ -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,19 @@ t("All files should have valid record types", (t) => {
|
||||
|
||||
t.pass();
|
||||
});
|
||||
|
||||
t("Root domains should have at least one usable record", (t) => {
|
||||
const usableRecordTypes = ["A", "AAAA", "CNAME", "MX", "NS", "URL"];
|
||||
|
||||
files.forEach((file) => {
|
||||
if (file.replace(/\.json$/, "").includes(".")) 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`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user