From 9079fa18859a13dddf2fe0623ddd627ea689d237 Mon Sep 17 00:00:00 2001 From: riotoff Date: Sun, 29 Dec 2024 13:03:34 +0300 Subject: [PATCH 01/15] Create chatting.json --- chatting.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 chatting.json diff --git a/chatting.json b/chatting.json new file mode 100644 index 000000000..c2652d957 --- /dev/null +++ b/chatting.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "riotoff", + "discord": "1040929084684902460" + }, + "record": { + "CNAME": "riotoff.github.io" + } +} From b64f66e25ebfd8475343e01194119d3d7ce9224c Mon Sep 17 00:00:00 2001 From: riotoff Date: Mon, 30 Dec 2024 15:24:02 +0300 Subject: [PATCH 02/15] Delete chatting.json --- chatting.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 chatting.json diff --git a/chatting.json b/chatting.json deleted file mode 100644 index c2652d957..000000000 --- a/chatting.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "riotoff", - "discord": "1040929084684902460" - }, - "record": { - "CNAME": "riotoff.github.io" - } -} From 2cb024972de136ce753c9b807514e9eba6136386 Mon Sep 17 00:00:00 2001 From: riotoff Date: Mon, 30 Dec 2024 15:24:48 +0300 Subject: [PATCH 03/15] Create chatting.json --- domains/chatting.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 domains/chatting.json diff --git a/domains/chatting.json b/domains/chatting.json new file mode 100644 index 000000000..c2652d957 --- /dev/null +++ b/domains/chatting.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "riotoff", + "discord": "1040929084684902460" + }, + "record": { + "CNAME": "riotoff.github.io" + } +} From 96f372f500daba99be0ce0aa3f11a99004e16bfa Mon Sep 17 00:00:00 2001 From: riotoff Date: Tue, 31 Dec 2024 19:00:19 +0300 Subject: [PATCH 04/15] Rename chatting.json to chattingmessenger.json --- domains/{chatting.json => chattingmessenger.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename domains/{chatting.json => chattingmessenger.json} (100%) diff --git a/domains/chatting.json b/domains/chattingmessenger.json similarity index 100% rename from domains/chatting.json rename to domains/chattingmessenger.json From 988994234dd49f8a04e2b1951e37040d4d8af046 Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:30:00 +0000 Subject: [PATCH 05/15] Delete domains/ai-y.json --- domains/ai-y.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/ai-y.json diff --git a/domains/ai-y.json b/domains/ai-y.json deleted file mode 100644 index 1ba829032..000000000 --- a/domains/ai-y.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "CNAME": "ai-y.onrender.com" - } -} From f0b7ca1f6cf08a4e94f6fd28a5e899cf6da0d503 Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:32:09 +0000 Subject: [PATCH 06/15] Delete domains/ai-y.yosuke.json --- domains/ai-y.yosuke.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/ai-y.yosuke.json diff --git a/domains/ai-y.yosuke.json b/domains/ai-y.yosuke.json deleted file mode 100644 index 632f9c315..000000000 --- a/domains/ai-y.yosuke.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "CNAME": "ai-y-main.pages.dev" - } -} From 5ee66dad225badbeca394eb66df6bb146c4ac253 Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:32:21 +0000 Subject: [PATCH 07/15] Delete domains/ai-y.yunexiz.json --- domains/ai-y.yunexiz.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/ai-y.yunexiz.json diff --git a/domains/ai-y.yunexiz.json b/domains/ai-y.yunexiz.json deleted file mode 100644 index 0ab726729..000000000 --- a/domains/ai-y.yunexiz.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "CNAME": "yunexiz.github.io" - } -} From 25dd15172957b56fd6a25244648b06588694464b Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:32:31 +0000 Subject: [PATCH 08/15] Delete domains/_github-pages-challenge-yunexiz.ai-y.yunexiz.json --- .../_github-pages-challenge-yunexiz.ai-y.yunexiz.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/_github-pages-challenge-yunexiz.ai-y.yunexiz.json diff --git a/domains/_github-pages-challenge-yunexiz.ai-y.yunexiz.json b/domains/_github-pages-challenge-yunexiz.ai-y.yunexiz.json deleted file mode 100644 index 5e584ec99..000000000 --- a/domains/_github-pages-challenge-yunexiz.ai-y.yunexiz.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "TXT": "44acf50d05a09c5bdcb82f64551e6c" - } -} From 55501e5a8a8c2e738b481e46f8cab6c365047d4b Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:39:19 +0000 Subject: [PATCH 09/15] Delete domains/1-train-ride-in-germany-is-300-euros.json --- domains/1-train-ride-in-germany-is-300-euros.json | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 domains/1-train-ride-in-germany-is-300-euros.json diff --git a/domains/1-train-ride-in-germany-is-300-euros.json b/domains/1-train-ride-in-germany-is-300-euros.json deleted file mode 100644 index e809964fb..000000000 --- a/domains/1-train-ride-in-germany-is-300-euros.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "owner": { - "username": "Yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "A": [ - "185.199.109.153", - "185.199.108.153", - "185.199.110.153", - "185.199.111.153" - ] - } -} From df7c9df27dcff914e71e6db0ff2aa0ac04325ba3 Mon Sep 17 00:00:00 2001 From: Yosuke Nishiyama <141266522+Yunexiz@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:39:32 +0000 Subject: [PATCH 10/15] Delete domains/_github-pages-challenge-yunexiz.1-train-ride-in-germany-is-300-euros.json --- ...nge-yunexiz.1-train-ride-in-germany-is-300-euros.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/_github-pages-challenge-yunexiz.1-train-ride-in-germany-is-300-euros.json diff --git a/domains/_github-pages-challenge-yunexiz.1-train-ride-in-germany-is-300-euros.json b/domains/_github-pages-challenge-yunexiz.1-train-ride-in-germany-is-300-euros.json deleted file mode 100644 index 73f4376f4..000000000 --- a/domains/_github-pages-challenge-yunexiz.1-train-ride-in-germany-is-300-euros.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "Yunexiz", - "discord": "1040303561847881729" - }, - "record": { - "TXT": "a39a9e9549128753e8f6757a37d2c2" - } -} From 93f0ea28be8be86e9ee9db88667beaf89a21eb28 Mon Sep 17 00:00:00 2001 From: shockbs <77534483+shockbs@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:04:55 +0800 Subject: [PATCH 11/15] Delete domains/face-recognition.shockbs.json --- domains/face-recognition.shockbs.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 domains/face-recognition.shockbs.json diff --git a/domains/face-recognition.shockbs.json b/domains/face-recognition.shockbs.json deleted file mode 100644 index 6000dc098..000000000 --- a/domains/face-recognition.shockbs.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "shockbs", - "email": "apipherng@gmail.com" - }, - "record": { - "CNAME": "na-west1.surge.sh" - } -} From d795c1c873a4426162213b22bd896c079d2164d1 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:46:14 +0800 Subject: [PATCH 12/15] add basic pr tests --- .github/workflows/validation.yml | 9 +++++++++ tests/pr.test.js | 23 +++++++++++++++++++++++ util/administrators.json | 4 ++++ util/reserved-domains.json | 4 +++- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 tests/pr.test.js create mode 100644 util/administrators.json diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index d48c9a347..c5dd5964a 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -36,6 +36,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get Modified JSON Files + id: modified_files + run: | + MODIFIED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^domains/.*\.json$' | sed 's|.*/||' | tr '\n' ',' | sed 's|,$||') + echo "MODIFIED_FILES=${MODIFIED_FILES}" >> $GITHUB_ENV + - run: npm install - run: npm test + env: + PULL_REQUEST: ${{ github.event.pull_request.number || false }} # false if not a PR + MODIFIED_FILES: ${{ env.MODIFIED_FILES }} diff --git a/tests/pr.test.js b/tests/pr.test.js new file mode 100644 index 000000000..6e5588fd7 --- /dev/null +++ b/tests/pr.test.js @@ -0,0 +1,23 @@ +if (!process.env.PULL_REQUEST) return; + +const t = require("ava"); +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 domainsPath = path.resolve("domains"); + +const admins = require("../util/administrators.json"); + +t("Modified JSON files must be owned by the PR author", (t) => { + MODIFIED_FILES.forEach((file) => { + const domain = fs.readJsonSync(path.join(domainsPath, file)); + + t.true( + domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), + `${file}: Owner should be ${PR_AUTHOR} but is ${domain.owner}` + ); + }); +}); diff --git a/util/administrators.json b/util/administrators.json new file mode 100644 index 000000000..f85832ced --- /dev/null +++ b/util/administrators.json @@ -0,0 +1,4 @@ +[ + "wdhdev", + "DEV-DIBSTER" +] \ No newline at end of file diff --git a/util/reserved-domains.json b/util/reserved-domains.json index 67087b209..42a683c8c 100644 --- a/util/reserved-domains.json +++ b/util/reserved-domains.json @@ -8,7 +8,9 @@ "api", "auth", "authentication", + "authorisation", "authorise", + "authorization", "authorize", "aux", "billing", @@ -17,6 +19,7 @@ "cart", "catalog", "checkout", + "co", "com", "com[1-9]", "con", @@ -74,7 +77,6 @@ "payments", "portal", "postmaster", - "prn", "recovery", "redirect", "registrar", From b7739fb0c843cb79e878f26e64d1aaf828b10f96 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:48:03 +0800 Subject: [PATCH 13/15] 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 c5dd5964a..259be4388 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -46,5 +46,5 @@ jobs: - run: npm test env: - PULL_REQUEST: ${{ github.event.pull_request.number || false }} # false if not a PR + PULL_REQUEST: ${{ github.event_name == 'pull_request' }} MODIFIED_FILES: ${{ env.MODIFIED_FILES }} From f78a7beddc96b8384dd25a2e0db5dbae2cbb9e96 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:54:05 +0800 Subject: [PATCH 14/15] updates --- .github/workflows/stale.yml | 31 +++++++++++++++---------------- .github/workflows/validation.yml | 9 ++------- tests/pr.test.js | 9 ++++++--- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9eefecd7b..ad78c7b61 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,21 +1,20 @@ name: StaleBOT on: - workflow_dispatch: - name: 'Force cleanup' - schedule: - - cron: "30 14 * * *" + workflow_dispatch: + schedule: + - cron: "30 14 * * *" jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 7 - days-before-close: 3 - stale-issue-message: 'This issue has been marked as stale due to inactivity and will be closed. Comment anything on this issue to prevent it' - stale-pr-message: 'This pull request has been marked as stale due to inactivity and will be closed. Comment anything on this PR to prevent it' - exempt-issue-labels: 'no-stale' - exempt-pr-labels: 'no-stale' + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 7 + days-before-close: 3 + stale-issue-message: "This issue has been marked as stale due to inactivity and will be closed. Comment anything on this issue to prevent it" + stale-pr-message: "This pull request has been marked as stale due to inactivity and will be closed. Comment anything on this PR to prevent it" + exempt-issue-labels: "no-stale" + exempt-pr-labels: "no-stale" diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 259be4388..0a11830df 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -36,15 +36,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get Modified JSON Files - id: modified_files - run: | - MODIFIED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^domains/.*\.json$' | sed 's|.*/||' | tr '\n' ',' | sed 's|,$||') - echo "MODIFIED_FILES=${MODIFIED_FILES}" >> $GITHUB_ENV - - run: npm install - run: npm test env: - PULL_REQUEST: ${{ github.event_name == 'pull_request' }} + EVENT: ${{ github.event_name }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} MODIFIED_FILES: ${{ env.MODIFIED_FILES }} diff --git a/tests/pr.test.js b/tests/pr.test.js index 6e5588fd7..98a153a7d 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -1,5 +1,3 @@ -if (!process.env.PULL_REQUEST) return; - const t = require("ava"); const fs = require("fs-extra"); const path = require("path"); @@ -12,12 +10,17 @@ const domainsPath = path.resolve("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") { + t.pass(); + return; + } + MODIFIED_FILES.forEach((file) => { const domain = fs.readJsonSync(path.join(domainsPath, file)); t.true( domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR), - `${file}: Owner should be ${PR_AUTHOR} but is ${domain.owner}` + `${file}: Owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author` ); }); }); From 79487832232ae80939327db1d558ceb2d169ce34 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:56:36 +0800 Subject: [PATCH 15/15] Update validation.yml --- .github/workflows/validation.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 0a11830df..3b9476f0e 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -38,8 +38,14 @@ jobs: - run: npm install + - name: Get modified files + if: github.event_name == 'pull_request' + id: files + run: | + echo "::set-output name=files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})" + - run: npm test env: EVENT: ${{ github.event_name }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} - MODIFIED_FILES: ${{ env.MODIFIED_FILES }} + MODIFIED_FILES: ${{ steps.files.outputs.files || '' }}