mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-15 18:16:07 +00:00
Merge branch 'main' into main
This commit is contained in:
3 files changed
+41
-1
No files matched your search
@@ -13,7 +13,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-validation
|
||||
group: pr-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"description": "gateway for site",
|
||||
"domain": "localplayer.dev",
|
||||
"subdomain": "lovely",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/Gj4meZ/rsr",
|
||||
"email": "chilliatogj4mez@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"A": ["87.106.232.208"]
|
||||
},
|
||||
|
||||
"proxied": true
|
||||
}
|
||||
@@ -80,6 +80,30 @@ t("All files should have the required fields", (t) => {
|
||||
});
|
||||
});
|
||||
|
||||
t("All filenames, subdomains, and domains must be lowercase", (t) => {
|
||||
const files = fs.readdirSync(domainsPath).filter(file => {
|
||||
const filePath = path.join(domainsPath, file);
|
||||
return file.endsWith(".json") && fs.lstatSync(filePath).isFile();
|
||||
});
|
||||
|
||||
files.forEach(file => {
|
||||
const filePath = path.join(domainsPath, file);
|
||||
const data = fs.readJsonSync(filePath);
|
||||
|
||||
// Check filename is lowercase
|
||||
t.is(file, file.toLowerCase(), `${file}: Filename must be lowercase`);
|
||||
|
||||
const { subdomain, domain } = data;
|
||||
|
||||
// Check JSON values are lowercase
|
||||
t.truthy(subdomain, `${file}: Missing subdomain field`);
|
||||
t.truthy(domain, `${file}: Missing domain field`);
|
||||
|
||||
t.is(subdomain, subdomain.toLowerCase(), `${file}: Subdomain must be lowercase`);
|
||||
t.is(domain, domain.toLowerCase(), `${file}: Domain must be lowercase`);
|
||||
});
|
||||
});
|
||||
|
||||
t("All files should have valid optional owner fields", (t) => {
|
||||
const files = fs.readdirSync(domainsPath).filter(file => {
|
||||
const filePath = path.join(domainsPath, file);
|
||||
|
||||
Reference in new issue
Block a user