Merge pull request #17172 from is-a-dev/wdhdev/self-reference-cname

feat(ci): domains should not reference themselves
This commit is contained in:
William Harrison
2024-11-14 13:41:26 +11:00
committed by GitHub
+16 -1
View File
@@ -138,7 +138,10 @@ t("All files should have valid record values", (t) => {
t.true(Array.isArray(value), `${file}: Record value should be an array for ${key}`);
value.forEach((record) => {
t.true(typeof record === "string", `${file}: Record value should be a string for ${key}`);
t.true(
typeof record === "string",
`${file}: Record value should be a string for ${key} at index ${value.indexOf(record)}`
);
});
// A: string[]
@@ -201,6 +204,18 @@ t("All files should have valid record values", (t) => {
if (key === "CNAME") {
t.regex(value, hostnameRegex, `${file}: Record value should be a valid hostname for ${key}`);
if(file === "@.json") {
t.false(
value === "is-a.dev",
`${file}: Record value should not reference itself for ${key}`
);
} else {
t.false(
value === file.replace(/\.json$/, "") + ".is-a.dev",
`${file}: Record value should not reference itself for ${key}`
);
}
}
if (key === "URL") {