mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-09-05 12:16:58 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -36,6 +36,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Clone is-a-dev/register
|
||||
run: git clone https://github.com/is-a-dev/register.git register-${{ github.run_id }}
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Get all modified domain JSON files
|
||||
@@ -45,17 +48,10 @@ 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
|
||||
- name: Run tests
|
||||
run: npx ava 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 }}
|
||||
|
||||
+2
-1
@@ -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)
|
||||
|
||||
+1
-2
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "enderfoxbg",
|
||||
"discord": "970380468090437672"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["dh=75e9bdc423ca4351bb8938087b552bc2ee9a3e16"]
|
||||
}
|
||||
}
|
||||
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "ajtabjs",
|
||||
"email": "oro10jua@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "ajtabjs.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "lunas-private-dungeon",
|
||||
"email": "luna.tsx@proton.me",
|
||||
"discord": "507625218467168257"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "alisa-win95.vercel.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
+51
-12
@@ -3,28 +3,67 @@ 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(" ").map((file) => file.replace(/^domains\//, ""));
|
||||
const EVENT = process.env.EVENT;
|
||||
const RUN_ID = process.env.RUN_ID;
|
||||
|
||||
const domainsPath = path.resolve("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") {
|
||||
t.pass();
|
||||
return;
|
||||
async function getJSONContent(basePath, fileName) {
|
||||
try {
|
||||
return await fs.readJson(path.join(basePath, fileName));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
MODIFIED_FILES.forEach((file) => {
|
||||
const domain = fs.readJsonSync(path.join(domainsPath, file));
|
||||
t("Modified JSON files must be owned by the PR author", async (t) => {
|
||||
if (EVENT !== "pull_request") return t.pass();
|
||||
|
||||
const checks = MODIFIED_FILES.map(async (file) => {
|
||||
const [modifiedDomain, currentDomain] = await Promise.all([
|
||||
getJSONContent(domainsPath, file),
|
||||
getJSONContent(headDomainsPath, file)
|
||||
]);
|
||||
|
||||
const domainToCheck = currentDomain || modifiedDomain;
|
||||
|
||||
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 [newFiles, currentFiles] = await Promise.all([fs.readdir(domainsPath), fs.readdir(headDomainsPath)]);
|
||||
|
||||
const newDomainFiles = newFiles.filter((file) => !currentFiles.includes(file));
|
||||
|
||||
const checks = newDomainFiles.map(async (file) => {
|
||||
const domain = await getJSONContent(domainsPath, file);
|
||||
|
||||
if (!domain) return t.fail(`${file}: Unable to read domain data`);
|
||||
|
||||
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`
|
||||
);
|
||||
});
|
||||
|
||||
await Promise.all(checks);
|
||||
t.pass();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user