mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-09-03 08:18:56 +00:00
Merge pull request #17172 from is-a-dev/wdhdev/self-reference-cname
feat(ci): domains should not reference themselves
This commit is contained in:
+16
-1
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user