mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-05-21 16:25:54 +00:00
Merge branch 'main' into main
This commit is contained in:
+15
-16
@@ -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"
|
||||
|
||||
@@ -36,6 +36,22 @@ 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
|
||||
|
||||
- run: npm test
|
||||
- name: Get all modified domain JSON files
|
||||
if: github.event_name == 'pull_request'
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: domains/*.json
|
||||
|
||||
- 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"]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "shockbs",
|
||||
"email": "apipherng@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "na-west1.surge.sh"
|
||||
}
|
||||
}
|
||||
@@ -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,69 @@
|
||||
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(" ").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");
|
||||
|
||||
async function getJSONContent(basePath, fileName) {
|
||||
try {
|
||||
return await fs.readJson(path.join(basePath, fileName));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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}: Domain owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author`
|
||||
);
|
||||
});
|
||||
|
||||
await Promise.all(checks);
|
||||
t.pass();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
[
|
||||
"wdhdev",
|
||||
"DEV-DIBSTER"
|
||||
]
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user