From 616f0e68b0a1445db82162775c34e7027fb62eeb Mon Sep 17 00:00:00 2001 From: ajtabjs <134237782+ajtabjs@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:36:41 -0800 Subject: [PATCH 01/44] Create ajtabs.json --- domains/ajtabs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 domains/ajtabs diff --git a/domains/ajtabs b/domains/ajtabs new file mode 100644 index 000000000..5cb58c59c --- /dev/null +++ b/domains/ajtabs @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "ajtabjs", + "email": "oro10jua@gmail.com" + }, + "record": { + "CNAME": "ajtabjs.github.io" + } +} From c39b5eaff79c56bfecf2cd285a03aab8a84bb900 Mon Sep 17 00:00:00 2001 From: LIGMATV Date: Thu, 2 Jan 2025 10:04:39 +0700 Subject: [PATCH 02/44] Update 2.json --- domains/2.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/domains/2.json b/domains/2.json index d6fc683e0..5e6f21eae 100644 --- a/domains/2.json +++ b/domains/2.json @@ -1,11 +1,10 @@ { "description": "LIGMATV's URL Manager (aka 2)", - "repo": "https://github.com/LIGMATV/links", "owner": { "username": "LIGMATV", "email": "ligmatv.id@gmail.com" }, "record": { - "CNAME": "ligmatv.github.io" + "CNAME": "ligmatv-links.vercel.app" } } From dce19c87de7e0186319fd79770f4212536c489e9 Mon Sep 17 00:00:00 2001 From: LIGMATV Date: Thu, 2 Jan 2025 10:12:46 +0700 Subject: [PATCH 03/44] Create _vercel.2.json --- domains/_vercel.2.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/_vercel.2.json diff --git a/domains/_vercel.2.json b/domains/_vercel.2.json new file mode 100644 index 000000000..24db2720e --- /dev/null +++ b/domains/_vercel.2.json @@ -0,0 +1,10 @@ +{ + "description": "LIGMATV's URL Manager (aka 2)", + "owner": { + "username": "LIGMATV", + "email": "ligmatv.id@gmail.com" + }, + "record": { + "TXT": ["vc-domain-verify=2.is-a.dev,ea014a1b9a6ec8986aa0"] + } +} From 987ec14c6b42dcfd500d35dbb901d0cffd3c7e28 Mon Sep 17 00:00:00 2001 From: Manish <87753285+m-manish03@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:42:06 +0530 Subject: [PATCH 04/44] Create manish-madi.json --- domains/manish-madi.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/manish-madi.json diff --git a/domains/manish-madi.json b/domains/manish-madi.json new file mode 100644 index 000000000..fe4f90072 --- /dev/null +++ b/domains/manish-madi.json @@ -0,0 +1,11 @@ +{ + "description": "Manish's Personal Website", + "repo": "https://github.com/m-manish03/m-manish03", + "owner": { + "username": "m-manish03", + "email": "manish.rebel14@gmail.com" + }, + "record": { + "CNAME": "m-manish03.github.io" + } +} From 6f84fc787b15ec1cf0b8dc7788eaffc543215cb6 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 13:12:32 +0530 Subject: [PATCH 05/44] Create hash-cracker.json --- domains/hash-cracker.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 domains/hash-cracker.json diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/domains/hash-cracker.json @@ -0,0 +1 @@ + From 4bf905878415b3df047261efe7052bc04bb86138 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 13:18:11 +0530 Subject: [PATCH 06/44] Create Hash-Cracker.json --- domains/Hash-Cracker.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 domains/Hash-Cracker.json diff --git a/domains/Hash-Cracker.json b/domains/Hash-Cracker.json new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/domains/Hash-Cracker.json @@ -0,0 +1 @@ + From afa54538db2954b3740a848e92b0c8dceaa814b1 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 13:21:12 +0530 Subject: [PATCH 07/44] Delete domains/Hash-Cracker.json --- domains/Hash-Cracker.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 domains/Hash-Cracker.json diff --git a/domains/Hash-Cracker.json b/domains/Hash-Cracker.json deleted file mode 100644 index 8b1378917..000000000 --- a/domains/Hash-Cracker.json +++ /dev/null @@ -1 +0,0 @@ - From 464ebb2db511978aa136ed82da03cb56c3082526 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 13:23:19 +0530 Subject: [PATCH 08/44] Create Hash-Cracker.json --- domains/Hash-Cracker.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 domains/Hash-Cracker.json diff --git a/domains/Hash-Cracker.json b/domains/Hash-Cracker.json new file mode 100644 index 000000000..489333b0e --- /dev/null +++ b/domains/Hash-Cracker.json @@ -0,0 +1,8 @@ +{ + "owner": { + "username": "Hash-Cracker" + }, + "record": { + "CNAME": "Hash-Cracker.github.io" + } +} From 7c390e0dd8bd5acc2b2951a5e75dd05f0d668a88 Mon Sep 17 00:00:00 2001 From: WinStuff <104269577+enderfoxbg@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:57:46 +0200 Subject: [PATCH 09/44] Create _discord.justwinstuff.json --- domains/_discord.justwinstuff.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 domains/_discord.justwinstuff.json diff --git a/domains/_discord.justwinstuff.json b/domains/_discord.justwinstuff.json new file mode 100644 index 000000000..f846fd946 --- /dev/null +++ b/domains/_discord.justwinstuff.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "enderfoxbg", + "discord": "970380468090437672" + }, + "record": { + "TXT": ["dh=75e9bdc423ca4351bb8938087b552bc2ee9a3e16"] + } +} From 493a47913856fac573370e3efb92f5789e6a0ec8 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 15:40:56 +0530 Subject: [PATCH 10/44] Delete domains/Hash-Cracker.json --- domains/Hash-Cracker.json | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 domains/Hash-Cracker.json diff --git a/domains/Hash-Cracker.json b/domains/Hash-Cracker.json deleted file mode 100644 index 489333b0e..000000000 --- a/domains/Hash-Cracker.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "owner": { - "username": "Hash-Cracker" - }, - "record": { - "CNAME": "Hash-Cracker.github.io" - } -} From 9bbf70b9466cf2c5cc587db4e34b3a45c8cb02f2 Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 15:43:33 +0530 Subject: [PATCH 11/44] Update hash-cracker.json --- domains/hash-cracker.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json index 8b1378917..489333b0e 100644 --- a/domains/hash-cracker.json +++ b/domains/hash-cracker.json @@ -1 +1,8 @@ - +{ + "owner": { + "username": "Hash-Cracker" + }, + "record": { + "CNAME": "Hash-Cracker.github.io" + } +} From f7e410c0cfa6225caa01fc79b19caa48fa30a5ff Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 15:48:14 +0530 Subject: [PATCH 12/44] Update hash-cracker.json --- domains/hash-cracker.json | 1 + 1 file changed, 1 insertion(+) diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json index 489333b0e..932ddd189 100644 --- a/domains/hash-cracker.json +++ b/domains/hash-cracker.json @@ -1,6 +1,7 @@ { "owner": { "username": "Hash-Cracker" + "email": "tspamiitesh@gmail.com" }, "record": { "CNAME": "Hash-Cracker.github.io" From 82c124038a41a9e0eff233f8de538805eb28a1aa Mon Sep 17 00:00:00 2001 From: Amiitesh TSP Date: Thu, 2 Jan 2025 15:52:32 +0530 Subject: [PATCH 13/44] Update hash-cracker.json --- domains/hash-cracker.json | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json index 932ddd189..576894dc0 100644 --- a/domains/hash-cracker.json +++ b/domains/hash-cracker.json @@ -1,9 +1,11 @@ { - "owner": { - "username": "Hash-Cracker" - "email": "tspamiitesh@gmail.com" - }, - "record": { - "CNAME": "Hash-Cracker.github.io" - } -} + "description": "A portfolio website", + "repo": "https://github.com/hash-cracker/hash-cracker.github.io", + "owner": { + "username": "hash-cracker", + "email": "tspamiitesh@gmail.com", + }, + "record": { + "CNAME": "hash-cracker.github.io" + } +} From 51867e7928be720e5b9cb2f529685583c0b1e5c1 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:33:10 +0800 Subject: [PATCH 14/44] more pr tests --- .github/workflows/validation.yml | 16 +++++++--------- tests/pr.test.js | 31 +++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 4f9863fc7..92a03e6bb 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -35,6 +35,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + path: ${{ github.run_id }} + + - uses: actions/checkout@v4 + with: + repository: is-a-dev/register + path: register - run: npm install @@ -45,15 +52,6 @@ jobs: with: files: domains/*.json - - name: testing - run: | - ls - ls ../ - echo ${{ steps.changed-files.outputs.all_changed_files }} - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - cat $file - done - - run: npm test env: EVENT: ${{ github.event_name }} diff --git a/tests/pr.test.js b/tests/pr.test.js index 5de425a0f..ccd3015f0 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -10,6 +10,7 @@ for (let i = 0; i < MODIFIED_FILES.length; i++) { } const domainsPath = path.resolve("domains"); +const headDomainsPath = path.resolve("../register/domains"); const admins = require("../util/administrators.json"); @@ -20,11 +21,37 @@ t("Modified JSON files must be owned by the PR author", (t) => { } MODIFIED_FILES.forEach((file) => { + const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file)); + let currentDomain = null; + + try { + currentDomain = fs.readJsonSync(path.join(headDomainsPath, file)); + } catch { + currentDomain = modifiedDomain; + } + + t.true( + currentDomain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` + ); + }); +}); + + +t("New JSON files must be owned by the PR author", (t) => { + if(process.env.EVENT !== "pull_request") { + t.pass(); + return; + } + + const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file)); + + newFiles.forEach((file) => { const domain = fs.readJsonSync(path.join(domainsPath, file)); t.true( domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` + `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` ); }); -}); +}) From 1e53e46efc64a72706ed969e61eae27e24c1a736 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:35:27 +0800 Subject: [PATCH 15/44] Update validation.yml --- .github/workflows/validation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 92a03e6bb..10c7c4aa5 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -41,7 +41,9 @@ jobs: - uses: actions/checkout@v4 with: repository: is-a-dev/register - path: register + path: ../register + + - run: cd ${{ github.run_id }} - run: npm install From 67e6b7b0ac8d045335d4c450d7e08fb3afc83122 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:37:35 +0800 Subject: [PATCH 16/44] Update validation.yml --- .github/workflows/validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 10c7c4aa5..0b6dd409f 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -43,7 +43,7 @@ jobs: repository: is-a-dev/register path: ../register - - run: cd ${{ github.run_id }} + - run: ls - run: npm install From 6993488eb28e531c88fb795d55c537b1d5d433d8 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:41:05 +0800 Subject: [PATCH 17/44] fixes --- .github/workflows/validation.yml | 6 +++++- tests/pr.test.js | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 0b6dd409f..aaa0bab1a 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -44,6 +44,7 @@ jobs: path: ../register - run: ls + - run: ls ../ - run: npm install @@ -54,8 +55,11 @@ jobs: with: files: domains/*.json - - run: npm test + - run: cd .. + + - run: npx ava register/tests/*.test.js env: EVENT: ${{ github.event_name }} + RUN_ID: ${{ github.run_id }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} MODIFIED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/tests/pr.test.js b/tests/pr.test.js index ccd3015f0..9244460ff 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -9,8 +9,8 @@ for (let i = 0; i < MODIFIED_FILES.length; i++) { MODIFIED_FILES[i] = MODIFIED_FILES[i].substring(MODIFIED_FILES[i].lastIndexOf("/") + 1); } -const domainsPath = path.resolve("domains"); -const headDomainsPath = path.resolve("../register/domains"); +const domainsPath = path.resolve(`${process.env.RUN_ID}/domains`); +const headDomainsPath = path.resolve("register/domains"); const admins = require("../util/administrators.json"); From ebe879e492e9003d09b70be40cd6fa595ff5a17b Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:44:24 +0800 Subject: [PATCH 18/44] Update validation.yml --- .github/workflows/validation.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index aaa0bab1a..9f17e9dae 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -43,8 +43,10 @@ jobs: repository: is-a-dev/register path: ../register - - run: ls - - run: ls ../ + - run: | + ls + ls ../ + ls ../ - run: npm install From 2f31cd774869920122aa7d58ef5dca15243bb77c Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:49:51 +0800 Subject: [PATCH 19/44] fix stuff --- .github/workflows/validation.yml | 14 +++----------- tests/pr.test.js | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 9f17e9dae..f77187016 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -35,18 +35,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - path: ${{ github.run_id }} - uses: actions/checkout@v4 with: repository: is-a-dev/register - path: ../register - - - run: | - ls - ls ../ - ls ../ + path: register-${{ github.run_id }} - run: npm install @@ -57,9 +50,8 @@ jobs: with: files: domains/*.json - - run: cd .. - - - run: npx ava register/tests/*.test.js + - name: Run tests + run: npx ava tests/*.test.js env: EVENT: ${{ github.event_name }} RUN_ID: ${{ github.run_id }} diff --git a/tests/pr.test.js b/tests/pr.test.js index 9244460ff..f178ddecd 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -9,8 +9,8 @@ for (let i = 0; i < MODIFIED_FILES.length; i++) { MODIFIED_FILES[i] = MODIFIED_FILES[i].substring(MODIFIED_FILES[i].lastIndexOf("/") + 1); } -const domainsPath = path.resolve(`${process.env.RUN_ID}/domains`); -const headDomainsPath = path.resolve("register/domains"); +const domainsPath = path.resolve("domains"); +const headDomainsPath = path.resolve(`register-${process.env.RUN_ID}/domains`); const admins = require("../util/administrators.json"); From ec4e7b5676454c61ac53c2ea51bafea99cc4be16 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:53:15 +0800 Subject: [PATCH 20/44] maybe this will fix it --- tests/pr.test.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index f178ddecd..8a6ac0ebd 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -3,11 +3,7 @@ const fs = require("fs-extra"); const path = require("path"); const PR_AUTHOR = process.env.PR_AUTHOR; -let MODIFIED_FILES = process.env.MODIFIED_FILES.split(" "); - -for (let i = 0; i < MODIFIED_FILES.length; i++) { - MODIFIED_FILES[i] = MODIFIED_FILES[i].substring(MODIFIED_FILES[i].lastIndexOf("/") + 1); -} +const MODIFIED_FILES = process.env.MODIFIED_FILES.split(" "); const domainsPath = path.resolve("domains"); const headDomainsPath = path.resolve(`register-${process.env.RUN_ID}/domains`); @@ -21,11 +17,11 @@ t("Modified JSON files must be owned by the PR author", (t) => { } MODIFIED_FILES.forEach((file) => { - const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file)); + const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); let currentDomain = null; try { - currentDomain = fs.readJsonSync(path.join(headDomainsPath, file)); + currentDomain = fs.readJsonSync(path.join(headDomainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); } catch { currentDomain = modifiedDomain; } @@ -44,10 +40,10 @@ t("New JSON files must be owned by the PR author", (t) => { return; } - const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file)); + const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); newFiles.forEach((file) => { - const domain = fs.readJsonSync(path.join(domainsPath, file)); + const domain = fs.readJsonSync(path.join(domainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); t.true( domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), From 2434b8b429d058add3a4ca0caf3135bcd499e627 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:54:52 +0800 Subject: [PATCH 21/44] Update pr.test.js --- tests/pr.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 8a6ac0ebd..ff5bb2bd4 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -17,11 +17,11 @@ t("Modified JSON files must be owned by the PR author", (t) => { } MODIFIED_FILES.forEach((file) => { - const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); + const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file.substring(file.lastIndexOf("/") + 1))); let currentDomain = null; try { - currentDomain = fs.readJsonSync(path.join(headDomainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); + currentDomain = fs.readJsonSync(path.join(headDomainsPath, file.substring(file.lastIndexOf("/") + 1))); } catch { currentDomain = modifiedDomain; } @@ -40,10 +40,10 @@ t("New JSON files must be owned by the PR author", (t) => { return; } - const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); + const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file.substring(file.lastIndexOf("/") + 1))); newFiles.forEach((file) => { - const domain = fs.readJsonSync(path.join(domainsPath, file.substring(MODIFIED_FILES[i].lastIndexOf("/") + 1))); + const domain = fs.readJsonSync(path.join(domainsPath, file.substring(file.lastIndexOf("/") + 1))); t.true( domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), From 69eba1e0ade080de607b2cbec1c4254c4803dda6 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:59:09 +0800 Subject: [PATCH 22/44] optimise? --- tests/pr.test.js | 81 +++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index ff5bb2bd4..9013d173d 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -3,51 +3,74 @@ const fs = require("fs-extra"); const path = require("path"); const PR_AUTHOR = process.env.PR_AUTHOR; -const MODIFIED_FILES = process.env.MODIFIED_FILES.split(" "); +const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" "); +const EVENT = process.env.EVENT; +const RUN_ID = process.env.RUN_ID; const domainsPath = path.resolve("domains"); -const headDomainsPath = path.resolve(`register-${process.env.RUN_ID}/domains`); +const headDomainsPath = path.resolve(`register-${RUN_ID}/domains`); const admins = require("../util/administrators.json"); -t("Modified JSON files must be owned by the PR author", (t) => { - if(process.env.EVENT !== "pull_request") { +async function getFileContent(basePath, fileName) { + try { + return await fs.readJson(path.join(basePath, fileName)); + } catch (err) { + return null; + } +} + +t("Modified JSON files must be owned by the PR author", async (t) => { + if (EVENT !== "pull_request") { t.pass(); return; } - MODIFIED_FILES.forEach((file) => { - const modifiedDomain = fs.readJsonSync(path.join(domainsPath, file.substring(file.lastIndexOf("/") + 1))); - let currentDomain = null; + await Promise.all( + MODIFIED_FILES.map(async (file) => { + const fileName = file.substring(file.lastIndexOf("/") + 1); + const modifiedDomain = await getFileContent(domainsPath, fileName); + const currentDomain = (await getFileContent(headDomainsPath, fileName)) || modifiedDomain; - try { - currentDomain = fs.readJsonSync(path.join(headDomainsPath, file.substring(file.lastIndexOf("/") + 1))); - } catch { - currentDomain = modifiedDomain; - } + if (!modifiedDomain || !currentDomain) { + t.fail(`${file}: Unable to read domain data`); + return; + } - t.true( - currentDomain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` - ); - }); + t.true( + currentDomain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Domain owner is ${currentDomain.owner.username} but ${PR_AUTHOR} is the PR author` + ); + }) + ); }); - -t("New JSON files must be owned by the PR author", (t) => { - if(process.env.EVENT !== "pull_request") { +t("New JSON files must be owned by the PR author", async (t) => { + if (EVENT !== "pull_request") { t.pass(); return; } - const newFiles = fs.readdirSync(domainsPath).filter((file) => !fs.readdirSync(headDomainsPath).includes(file.substring(file.lastIndexOf("/") + 1))); + const domainsFiles = await fs.readdir(domainsPath); + const headDomainsFiles = await fs.readdir(headDomainsPath).catch(() => []); - newFiles.forEach((file) => { - const domain = fs.readJsonSync(path.join(domainsPath, file.substring(file.lastIndexOf("/") + 1))); + const newFiles = domainsFiles.filter( + (file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1)) + ); - t.true( - domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` - ); - }); -}) + await Promise.all( + newFiles.map(async (file) => { + const domain = await getFileContent(domainsPath, file); + + if (!domain) { + t.fail(`${file}: Unable to read domain data`); + return; + } + + t.true( + domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` + ); + }) + ); +}); From d3c928e900f8986aef215769a3d765c22c112fd5 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:04:44 +0800 Subject: [PATCH 23/44] Update pr.test.js --- tests/pr.test.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 9013d173d..2d2f5123b 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -43,21 +43,22 @@ t("Modified JSON files must be owned by the PR author", async (t) => { ); }) ); + + t.pass(); }); t("New JSON files must be owned by the PR author", async (t) => { - if (EVENT !== "pull_request") { - t.pass(); - return; - } + if (EVENT !== "pull_request") return t.pass(); const domainsFiles = await fs.readdir(domainsPath); - const headDomainsFiles = await fs.readdir(headDomainsPath).catch(() => []); + const headDomainsFiles = await fs.readdir(headDomainsPath); const newFiles = domainsFiles.filter( (file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1)) ); + console.log("New files", newFiles); + await Promise.all( newFiles.map(async (file) => { const domain = await getFileContent(domainsPath, file); @@ -73,4 +74,6 @@ t("New JSON files must be owned by the PR author", async (t) => { ); }) ); + + t.pass(); }); From b93d0f85a13922454252dc7ca25224161811fa84 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:07:35 +0800 Subject: [PATCH 24/44] Update pr.test.js --- tests/pr.test.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 2d2f5123b..7c3f8ebd9 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -21,10 +21,9 @@ async function getFileContent(basePath, fileName) { } t("Modified JSON files must be owned by the PR author", async (t) => { - if (EVENT !== "pull_request") { - t.pass(); - return; - } + if (EVENT !== "pull_request") return t.pass(); + + console.log("Modified files", MODIFIED_FILES); await Promise.all( MODIFIED_FILES.map(async (file) => { @@ -50,12 +49,9 @@ t("Modified JSON files must be owned by the PR author", async (t) => { t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); - const domainsFiles = await fs.readdir(domainsPath); const headDomainsFiles = await fs.readdir(headDomainsPath); - const newFiles = domainsFiles.filter( - (file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1)) - ); + const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file)); console.log("New files", newFiles); From a07afe4762bf5e137593c24ea8e88911dbaa7a99 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:10:31 +0800 Subject: [PATCH 25/44] Update pr.test.js --- tests/pr.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 7c3f8ebd9..dcc6ca21f 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -51,13 +51,13 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = await fs.readdir(headDomainsPath); - const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file)); + const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); console.log("New files", newFiles); await Promise.all( newFiles.map(async (file) => { - const domain = await getFileContent(domainsPath, file); + const domain = await getFileContent(domainsPath, file.substring(file.lastIndexOf("/") + 1)); if (!domain) { t.fail(`${file}: Unable to read domain data`); From c2706077dfa568c495be7a952b87f605230590a7 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:13:04 +0800 Subject: [PATCH 26/44] Update pr.test.js --- tests/pr.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index dcc6ca21f..b39f16190 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -49,7 +49,7 @@ t("Modified JSON files must be owned by the PR author", async (t) => { t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); - const headDomainsFiles = await fs.readdir(headDomainsPath); + const headDomainsFiles = fs.readdirSync(headDomainsPath); const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); From 28c053b4f891d8babb97f1615f2c578f072d34b1 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:13:12 +0800 Subject: [PATCH 27/44] Update pr.test.js --- tests/pr.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/pr.test.js b/tests/pr.test.js index b39f16190..88c220716 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -51,6 +51,8 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = fs.readdirSync(headDomainsPath); + console.log("Head files", headDomainsFiles); + const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); console.log("New files", newFiles); From e857069a2139ee467a15279a4e6b2436d4e4c028 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:14:59 +0800 Subject: [PATCH 28/44] Update pr.test.js --- tests/pr.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 88c220716..e571b3a5c 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -51,7 +51,9 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = fs.readdirSync(headDomainsPath); - console.log("Head files", headDomainsFiles); + console.log("Head files", headDomainsFiles.filter((file) => MODIFIED_FILES.includes(file.substring(file.lastIndexOf("/") + 1)))); + + console.log("Modified files", MODIFIED_FILES.map((file) => file.substring(file.lastIndexOf("/") + 1))); const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); From a52a3666612ada48c4e830a4c210f06500a56560 Mon Sep 17 00:00:00 2001 From: iostpa Date: Thu, 2 Jan 2025 14:15:09 +0200 Subject: [PATCH 29/44] Update domains/hash-cracker.json --- domains/hash-cracker.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json index 576894dc0..3e99e874d 100644 --- a/domains/hash-cracker.json +++ b/domains/hash-cracker.json @@ -3,7 +3,7 @@ "repo": "https://github.com/hash-cracker/hash-cracker.github.io", "owner": { "username": "hash-cracker", - "email": "tspamiitesh@gmail.com", + "email": "tspamiitesh@gmail.com" }, "record": { "CNAME": "hash-cracker.github.io" From e32bacdf9510471f6ef5994a3fefd113659fbe11 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:20:10 +0800 Subject: [PATCH 30/44] Update pr.test.js --- tests/pr.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index e571b3a5c..2be0b763d 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -51,11 +51,11 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = fs.readdirSync(headDomainsPath); - console.log("Head files", headDomainsFiles.filter((file) => MODIFIED_FILES.includes(file.substring(file.lastIndexOf("/") + 1)))); + console.log("Head files", headDomainsFiles.filter((file) => MODIFIED_FILES.includes(`domains/${file}`))); console.log("Modified files", MODIFIED_FILES.map((file) => file.substring(file.lastIndexOf("/") + 1))); - const newFiles = MODIFIED_FILES.filter((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); + const newFiles = MODIFIED_FILES.map((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); console.log("New files", newFiles); From b31ac96e45960b875c418d701880ce022bc52f6b Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:24:21 +0800 Subject: [PATCH 31/44] Update validation.yml --- .github/workflows/validation.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index f77187016..aba28c94c 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -41,6 +41,9 @@ jobs: repository: is-a-dev/register path: register-${{ github.run_id }} + - run: ls domain -1 | wc -l + - run: ls register-${{ github.run_id }}/domains -1 | wc -l + - run: npm install - name: Get all modified domain JSON files From 70dd4633a45dcbd29ba38245f326bafae1b20749 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:25:34 +0800 Subject: [PATCH 32/44] Update pr.test.js --- tests/pr.test.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 2be0b763d..f4a5a2cce 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -50,12 +50,9 @@ t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); const headDomainsFiles = fs.readdirSync(headDomainsPath); - - console.log("Head files", headDomainsFiles.filter((file) => MODIFIED_FILES.includes(`domains/${file}`))); - - console.log("Modified files", MODIFIED_FILES.map((file) => file.substring(file.lastIndexOf("/") + 1))); - - const newFiles = MODIFIED_FILES.map((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); + + // get list of all files that are in the base dir but not in the head dir + const newFiles = headDomainsFiles.filter((file) => !fs.existsSync(path.join(domainsPath, file))); console.log("New files", newFiles); From 76914ef175cb65be99cb999dbfba40af28a88664 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:29:08 +0800 Subject: [PATCH 33/44] try fix --- .github/workflows/validation.yml | 2 +- tests/pr.test.js | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index aba28c94c..ac0ca8394 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -41,7 +41,7 @@ jobs: repository: is-a-dev/register path: register-${{ github.run_id }} - - run: ls domain -1 | wc -l + - run: ls domains -1 | wc -l - run: ls register-${{ github.run_id }}/domains -1 | wc -l - run: npm install diff --git a/tests/pr.test.js b/tests/pr.test.js index f4a5a2cce..15b00c813 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -3,7 +3,7 @@ const fs = require("fs-extra"); const path = require("path"); const PR_AUTHOR = process.env.PR_AUTHOR; -const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" "); +const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map(file => file.replace(/^domains\//, "")); const EVENT = process.env.EVENT; const RUN_ID = process.env.RUN_ID; @@ -23,13 +23,10 @@ async function getFileContent(basePath, fileName) { t("Modified JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); - console.log("Modified files", MODIFIED_FILES); - await Promise.all( MODIFIED_FILES.map(async (file) => { - const fileName = file.substring(file.lastIndexOf("/") + 1); - const modifiedDomain = await getFileContent(domainsPath, fileName); - const currentDomain = (await getFileContent(headDomainsPath, fileName)) || modifiedDomain; + const modifiedDomain = await getFileContent(domainsPath, file); + const currentDomain = (await getFileContent(headDomainsPath, file)) || modifiedDomain; if (!modifiedDomain || !currentDomain) { t.fail(`${file}: Unable to read domain data`); @@ -51,14 +48,13 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = fs.readdirSync(headDomainsPath); - // get list of all files that are in the base dir but not in the head dir const newFiles = headDomainsFiles.filter((file) => !fs.existsSync(path.join(domainsPath, file))); console.log("New files", newFiles); await Promise.all( newFiles.map(async (file) => { - const domain = await getFileContent(domainsPath, file.substring(file.lastIndexOf("/") + 1)); + const domain = await getFileContent(domainsPath, file); if (!domain) { t.fail(`${file}: Unable to read domain data`); From 7f6467ea4153204462894d4ccdb28c61d291ab7c Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:31:24 +0800 Subject: [PATCH 34/44] fix cloning --- .github/workflows/validation.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index ac0ca8394..f27cd2dbe 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -36,10 +36,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - with: - repository: is-a-dev/register - path: register-${{ github.run_id }} + - run: git clone https://github.com/is-a-dev/register.git register-${{ github.run_id }} - run: ls domains -1 | wc -l - run: ls register-${{ github.run_id }}/domains -1 | wc -l From 55b60ba3f72d7fab787a2b7ff290bdbd004bc5f0 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:33:37 +0800 Subject: [PATCH 35/44] fixes --- .github/workflows/validation.yml | 6 ++---- tests/pr.test.js | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index f27cd2dbe..6e86fabc5 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -36,10 +36,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git clone https://github.com/is-a-dev/register.git register-${{ github.run_id }} - - - run: ls domains -1 | wc -l - - run: ls register-${{ github.run_id }}/domains -1 | wc -l + - name: Clone is-a-dev/register + run: git clone https://github.com/is-a-dev/register.git register-${{ github.run_id }} - run: npm install diff --git a/tests/pr.test.js b/tests/pr.test.js index 15b00c813..ecfe7605e 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -48,9 +48,7 @@ t("New JSON files must be owned by the PR author", async (t) => { const headDomainsFiles = fs.readdirSync(headDomainsPath); - const newFiles = headDomainsFiles.filter((file) => !fs.existsSync(path.join(domainsPath, file))); - - console.log("New files", newFiles); + const newFiles = domainsPath.filter((file) => !fs.existsSync(path.join(headDomainsFiles, file))); await Promise.all( newFiles.map(async (file) => { From 759001598cf45ba9baf6f23c79393423c5a51b1c Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:33:54 +0800 Subject: [PATCH 36/44] Update pr.test.js --- tests/pr.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index ecfe7605e..a590b0b4c 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -3,7 +3,7 @@ const fs = require("fs-extra"); const path = require("path"); const PR_AUTHOR = process.env.PR_AUTHOR; -const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map(file => file.replace(/^domains\//, "")); +const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map((file) => file.replace(/^domains\//, "")); const EVENT = process.env.EVENT; const RUN_ID = process.env.RUN_ID; @@ -47,9 +47,11 @@ t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); const headDomainsFiles = fs.readdirSync(headDomainsPath); - + const newFiles = domainsPath.filter((file) => !fs.existsSync(path.join(headDomainsFiles, file))); + console.log(newFiles); + await Promise.all( newFiles.map(async (file) => { const domain = await getFileContent(domainsPath, file); From 345104c3343e3e1990c8e06b7e706e661c8c41b7 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:39:48 +0800 Subject: [PATCH 37/44] Update pr.test.js --- tests/pr.test.js | 63 +++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index a590b0b4c..7bb79061b 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -12,10 +12,10 @@ const headDomainsPath = path.resolve(`register-${RUN_ID}/domains`); const admins = require("../util/administrators.json"); -async function getFileContent(basePath, fileName) { +async function getJSONContent(basePath, fileName) { try { return await fs.readJson(path.join(basePath, fileName)); - } catch (err) { + } catch { return null; } } @@ -23,50 +23,47 @@ async function getFileContent(basePath, fileName) { t("Modified JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); - await Promise.all( - MODIFIED_FILES.map(async (file) => { - const modifiedDomain = await getFileContent(domainsPath, file); - const currentDomain = (await getFileContent(headDomainsPath, file)) || modifiedDomain; + const checks = MODIFIED_FILES.map(async (file) => { + const [modifiedDomain, currentDomain] = await Promise.all([ + getJSONContent(domainsPath, file), + getJSONContent(headDomainsPath, file) + ]); - if (!modifiedDomain || !currentDomain) { - t.fail(`${file}: Unable to read domain data`); - return; - } + const domainToCheck = currentDomain || modifiedDomain; - t.true( - currentDomain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Domain owner is ${currentDomain.owner.username} but ${PR_AUTHOR} is the PR author` - ); - }) - ); + if (!modifiedDomain || !domainToCheck) { + t.fail(`${file}: Unable to read domain data`); + return; + } + t.true( + domainToCheck.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Domain owner is ${domainToCheck.owner.username} but ${PR_AUTHOR} is the PR author` + ); + }); + + await Promise.all(checks); t.pass(); }); t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); - const headDomainsFiles = fs.readdirSync(headDomainsPath); + const [newFiles, currentFiles] = await Promise.all([fs.readdir(domainsPath), fs.readdir(headDomainsPath)]); - const newFiles = domainsPath.filter((file) => !fs.existsSync(path.join(headDomainsFiles, file))); + const newDomainFiles = newFiles.filter((file) => !currentFiles.includes(file)); - console.log(newFiles); + const checks = newDomainFiles.map(async (file) => { + const domain = await getJSONContent(domainsPath, file); - await Promise.all( - newFiles.map(async (file) => { - const domain = await getFileContent(domainsPath, file); + if (!domain) return t.fail(`${file}: Unable to read domain data`); - if (!domain) { - t.fail(`${file}: Unable to read domain data`); - return; - } - - t.true( - domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` - ); - }) - ); + t.true( + domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` + ); + }); + await Promise.all(checks); t.pass(); }); From 4ca07a5bf394ae3e8dda44c35289279ba90bb89b Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:42:16 +0800 Subject: [PATCH 38/44] Update pr.test.js --- tests/pr.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/pr.test.js b/tests/pr.test.js index 7bb79061b..d0b08ce7c 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -53,6 +53,8 @@ t("New JSON files must be owned by the PR author", async (t) => { const newDomainFiles = newFiles.filter((file) => !currentFiles.includes(file)); + console.log(newDomainFiles); + const checks = newDomainFiles.map(async (file) => { const domain = await getJSONContent(domainsPath, file); From 476e9c6ef7349d8560c3e7732e5f2cb8c49a8d64 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:43:33 +0800 Subject: [PATCH 39/44] Update pr.test.js --- tests/pr.test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index d0b08ce7c..7bb79061b 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -53,8 +53,6 @@ t("New JSON files must be owned by the PR author", async (t) => { const newDomainFiles = newFiles.filter((file) => !currentFiles.includes(file)); - console.log(newDomainFiles); - const checks = newDomainFiles.map(async (file) => { const domain = await getJSONContent(domainsPath, file); From 573a974225f0c56520abd44e1a6e05821f77b5cc Mon Sep 17 00:00:00 2001 From: iostpa Date: Thu, 2 Jan 2025 14:47:11 +0200 Subject: [PATCH 40/44] Needs to be the exact username --- domains/hash-cracker.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/hash-cracker.json b/domains/hash-cracker.json index 3e99e874d..3c63d2ca7 100644 --- a/domains/hash-cracker.json +++ b/domains/hash-cracker.json @@ -2,7 +2,7 @@ "description": "A portfolio website", "repo": "https://github.com/hash-cracker/hash-cracker.github.io", "owner": { - "username": "hash-cracker", + "username": "Hash-Cracker", "email": "tspamiitesh@gmail.com" }, "record": { From 8970c1a5a04c1f81a46299f210191b0951660eeb Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:48:36 +0800 Subject: [PATCH 41/44] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index fa62aa12d..49cc4532e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,7 +14,7 @@ The abuse reports will be investigated and the necessary action will be taken. - Online stores/shopping websites - Gambling websites - Game cheat sites -- CDNs distributing potentially malicious content (APKs, executables) +- CDNs distributing potentially malicious content (e.g. APKs, executables) - 'Unblocked' gaming websites - Alternate URLs for commonly blocked websites (e.g. gambling/casino websites) - Websites containing 18+ content @@ -28,3 +28,4 @@ The abuse reports will be investigated and the necessary action will be taken. - Online services for identity theft or forgery - Platforms promoting self-harm or violence - Illegal drug marketplaces +- Proxy sites (e.g. embedding other websites) From b3f9e3b96fd4c358f17ac55ffa821d1e989ed174 Mon Sep 17 00:00:00 2001 From: ajtabjs <134237782+ajtabjs@users.noreply.github.com> Date: Thu, 2 Jan 2025 07:43:15 -0800 Subject: [PATCH 42/44] Rename ajtabs to ajtabs.json --- domains/{ajtabs => ajtabs.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename domains/{ajtabs => ajtabs.json} (100%) diff --git a/domains/ajtabs b/domains/ajtabs.json similarity index 100% rename from domains/ajtabs rename to domains/ajtabs.json From a649feeec341c1d3faaad5352133eedc31118c25 Mon Sep 17 00:00:00 2001 From: lunas-private-dungeon Date: Thu, 2 Jan 2025 22:40:15 +0100 Subject: [PATCH 43/44] Create _vercel.alisa.json --- domains/_vercel.alisa.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/_vercel.alisa.json diff --git a/domains/_vercel.alisa.json b/domains/_vercel.alisa.json new file mode 100644 index 000000000..efc76ec48 --- /dev/null +++ b/domains/_vercel.alisa.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "lunas-private-dungeon", + "email": "luna.tsx@proton.me", + "discord": "507625218467168257" + }, + "record": { + "TXT": ["vc-domain-verify=alisa.is-a.dev,01abd793050b01c5d63f"] + } +} From 41f912824a748a431fea6553a0a7316fd72eea04 Mon Sep 17 00:00:00 2001 From: lunas-private-dungeon Date: Thu, 2 Jan 2025 22:46:39 +0100 Subject: [PATCH 44/44] Create alisa.json --- domains/alisa.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/alisa.json diff --git a/domains/alisa.json b/domains/alisa.json new file mode 100644 index 000000000..78dae86ba --- /dev/null +++ b/domains/alisa.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "lunas-private-dungeon", + "email": "luna.tsx@proton.me", + "discord": "507625218467168257" + }, + "record": { + "CNAME": "alisa-win95.vercel.app" + } +}