mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-08-20 06:23:50 +00:00
fix tests
This commit is contained in:
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Get changed files
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
FILES=$(gh api --jq '[.[] | .filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files)
|
||||
FILES=$(gh api --jq '[.[] | select(.status != "removed") | .filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files)
|
||||
echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itsFatlum",
|
||||
"username": "itssfatlum",
|
||||
"email": "fatlum@lumi.is-a.dev"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"description": "Domain verification for my Bluesky account.",
|
||||
"owner": {
|
||||
"username": "razobeckett",
|
||||
"email": "razobeckett@proton.me"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "did=did:plc:w6h4dilqruly6q4zki2mj5qt"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "harunabdullah",
|
||||
"username": "harunabdullahrakin",
|
||||
"email": "harunabdullahrakin@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "JonathanXDR",
|
||||
"email": "jonathan.russ@bluewin.ch",
|
||||
"discord": "494042822320717827"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "dh=38d522d76c80c10c68fa083f015b65ef2986a91b"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itsFatlum",
|
||||
"username": "itssfatlum",
|
||||
"discord": "563697359423406082"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Roufox",
|
||||
"discord": "Roufox"
|
||||
"username": "Rouf0x",
|
||||
"discord": "roufox"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "dh=c3f8c6ef337cccc45ed0c1fac8f1dbbb76b86271"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "s8rr"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["dh=02cb947f7961bbd1816cb3aa4d2d47854665515c"]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itswhisp",
|
||||
"email": "ag.whisp@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "dh=f98e45bf000905131a5ee712210c9561d2079b24"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "LUMIDevelopment"
|
||||
"username": "itssfatlum"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["eade7c5be7"]
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "oyepriyansh",
|
||||
"email": "oyepriyansh@hotmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "0e84f14f3a"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"domain": "abiapp1789.is-a.dev",
|
||||
"owner": {
|
||||
"username": "abiapp789",
|
||||
"email": "abiapp2024@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "e8984bf946de59788c1b78b19b8d51"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "akpi816218",
|
||||
"discord": "equus_quagga"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "83f74e3c71720aa4514d32cabe7324"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"description": "Github page domain verification",
|
||||
"owner": {
|
||||
"username": "fa-fifi",
|
||||
"email": "fafifi1997@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "4076c15aac94a89c1a131d252cf368"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "JerBlox",
|
||||
"username": "i-Jer",
|
||||
"email": "chen.fuyuan07@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"description": "Personal website.",
|
||||
"repo": "https://github.com/lean-cc/Personal-site",
|
||||
"owner": {
|
||||
"username": "lean-cc",
|
||||
"email": "leancc3020@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "3c11059b471a5b5163437912c020df"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "ramanandkrgupta",
|
||||
"email": "ramanand@myyahoo.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "07cd3e879dce98546f212f494f50da"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "yashokuu",
|
||||
"username": "yashoukuu",
|
||||
"email": "yas.studios.en@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Harsh-0986",
|
||||
"email": "harsh2102.dev@gmail.com",
|
||||
"discord": "889700837520199761"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "vc-domain-verify=about.harshshah.is-a.dev,f9d8e16efb5cc0d31d96"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"description": "This website is my personal portfolio",
|
||||
"repo": "https://github.com/huamanraj/Portfolio-v4",
|
||||
"owner": {
|
||||
"username": "huamanraj",
|
||||
"email": "amanraj12.ar@gmail.com",
|
||||
"discord": "amanraj"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=amanraj.is-a.dev,25dd2c58bb98baf55cd4"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "greeshhma",
|
||||
"email": "greeshma864@gmail.com",
|
||||
"discord": "greeshhma"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "vc-domain-verify=greeshma.is-a.dev,dcf8eae911029ace6427"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "huuloc",
|
||||
"email": "huuloc2026@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": [
|
||||
"vc-domain-verify=huuloc.is-a.dev,251080b2d18334a71c6e"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "AdrielValecillo",
|
||||
"email": "",
|
||||
"discord": "386501216504512514"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "vc-domain-verify=isaiadriel.is-a.dev,bbb52dc1293221795089"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "JonathanXDR",
|
||||
"email": "jonathan.russ@bluewin.ch",
|
||||
"discord": "494042822320717827"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "vc-domain-verify=jonathan-russ.is-a.dev,298a207b5f94dffde572"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "manishgun",
|
||||
"email": "mail.cto.manish@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=manishgun.is-a.dev,f13d291aacd89c0da59c"]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "shshahms",
|
||||
"username": "shshams",
|
||||
"email": "shahadathossenshams@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Harsh-0986",
|
||||
"email": "harsh2102.dev@gmail.com",
|
||||
"discord": "889700837520199761"
|
||||
},
|
||||
"record": {
|
||||
"A": ["76.76.21.21"]
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
},
|
||||
"record": {
|
||||
"URL": "https://ackle.vercel.app/",
|
||||
"MX": ["mx1.improvmx.com", "mx2.improvmx.com"],
|
||||
"MX": ["mx1.improvmx.com", "mx2.imrovmx.com"],
|
||||
"TXT": ["v=spf1 include:spf.improvmx.com ~all"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "komaru-meow",
|
||||
"email": "winbo-yml-exe@outlook.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "komaru-discord.github.io"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itsFatlum",
|
||||
"username": "itssfatlum",
|
||||
"discord": "563697359423406082"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Marco-Voegeli",
|
||||
"email": "voegelijjm@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "marco-voegeli.github.io"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"description": "Portfolio",
|
||||
"repo": "https://github.com/Pedrofff23/Portfolio",
|
||||
"owner": {
|
||||
"username": "Pedrofff",
|
||||
"username": "Pedrofff23",
|
||||
"email": "pmendes09@hotmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"description": "roohullah.kazmi",
|
||||
"owner": {
|
||||
"username": "r-kazmi",
|
||||
"email": "smrkamzi@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"URL": "https://linktr.ee/roohullah.kazmi"
|
||||
},
|
||||
"proxied": false
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "schuh",
|
||||
"username": "vqpe",
|
||||
"email": "theschuhofyou@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"description": "subdomain for link redirection",
|
||||
"owner": {
|
||||
"username": "dedomil",
|
||||
"email": "ishqaddy@gmail.com",
|
||||
"twitter": "aadixl",
|
||||
"discord": "dedomil"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "edge.redirect.pizza"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "ArnavBarway",
|
||||
"email": "playnav.yt@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": [
|
||||
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSshIz5JRWquCDisgpRtbtWwMhzi2asXOamXxO6G80r4cNYll2/7AWSIxEKGV8t/eoGo9xiryfUXi0W5P5jHY6TWcdawPE/xBoBySt58dQtOElHEplukCYxyTotrvdQp1nH9w2jmexZfjXzOS97sGwUXHDWxNZjwT7hYf5Kzif+QIDAQAB"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ const t = require("ava");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
|
||||
const trustedUsers = require("../util/trusted.json").map((u) => u.toLowerCase());
|
||||
const trustedUsers = require("./util/trusted.json").map((u) => u.toLowerCase());
|
||||
|
||||
function getDomainData(subdomain) {
|
||||
try {
|
||||
+11
-28
@@ -21,31 +21,14 @@ function getDomainData(subdomain) {
|
||||
}
|
||||
}
|
||||
|
||||
function getParentSubdomain(subdomain) {
|
||||
const parts = subdomain.split(".");
|
||||
|
||||
if (parts.length <= 1) return null; // No parent for top-level subdomains
|
||||
|
||||
// Try to find the parent subdomain by iterating over the parts
|
||||
for (let i = parts.length - 1; i > 0; i--) {
|
||||
const potentialParent = parts.slice(i - 1).join(".");
|
||||
|
||||
if (files.includes(`${potentialParent}.json`)) {
|
||||
return potentialParent;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
t("Nested subdomains should not exist without a parent subdomain", (t) => {
|
||||
files.forEach((file) => {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const parentDomain = subdomain.split(".").reverse()[0];
|
||||
|
||||
if (subdomain.split(".").length > 1) {
|
||||
const parentSubdomain = getParentSubdomain(subdomain);
|
||||
if (parentDomain !== subdomain) {
|
||||
t.true(
|
||||
parentSubdomain && files.includes(`${parentSubdomain}.json`),
|
||||
parentDomain && files.includes(`${parentDomain}.json`),
|
||||
`${file}: Parent subdomain does not exist`
|
||||
);
|
||||
}
|
||||
@@ -55,12 +38,12 @@ t("Nested subdomains should not exist without a parent subdomain", (t) => {
|
||||
t("Nested subdomains should not exist if the parent subdomain has NS records", (t) => {
|
||||
files.forEach((file) => {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const parentDomain = subdomain.split(".").reverse()[0];
|
||||
|
||||
if (subdomain.split(".").length > 1) {
|
||||
const parentSubdomain = getParentSubdomain(subdomain);
|
||||
const parentDomain = getDomainData(parentSubdomain);
|
||||
if (parentDomain !== subdomain) {
|
||||
const parentData = getDomainData(parentDomain);
|
||||
|
||||
t.true(!parentDomain.record.NS, `${file}: Parent subdomain has NS records`);
|
||||
t.true(!parentData.record.NS, `${file}: Parent subdomain has NS records`);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -68,14 +51,14 @@ t("Nested subdomains should not exist if the parent subdomain has NS records", (
|
||||
t("Nested subdomains should be owned by the parent subdomain's owner", (t) => {
|
||||
files.forEach((file) => {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const parentDomain = subdomain.split(".").reverse()[0];
|
||||
|
||||
if (subdomain.split(".").length > 1) {
|
||||
if (parentDomain !== subdomain) {
|
||||
const data = getDomainData(subdomain);
|
||||
const parentSubdomain = getParentSubdomain(subdomain);
|
||||
const parentDomain = getDomainData(parentSubdomain);
|
||||
const parentData = getDomainData(parentDomain);
|
||||
|
||||
t.true(
|
||||
data.owner.username.toLowerCase() === parentDomain.owner.username.toLowerCase(),
|
||||
data.owner.username.toLowerCase() === parentData.owner.username.toLowerCase(),
|
||||
`${file}: Owner does not match the parent subdomain`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
[
|
||||
"21Z",
|
||||
"DEV-DIBSTER",
|
||||
"iostpa",
|
||||
"is-a-dev-bot",
|
||||
"orangci",
|
||||
"Stef-00012",
|
||||
"SX-9",
|
||||
"WDH-2",
|
||||
"wdhdev"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user