diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index de78330c..cc6ac600 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.ref }}-validation + group: pr-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: diff --git a/domains/lovely.localplayer.dev.json b/domains/lovely.localplayer.dev.json new file mode 100644 index 00000000..5bf314b0 --- /dev/null +++ b/domains/lovely.localplayer.dev.json @@ -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 +} diff --git a/tests/json.test.js b/tests/json.test.js index 5e5c50ea..aca87b76 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -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);