diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1521b5990..91d81f6e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ on: - "tests/*" - "util/*" - ".github/workflows/ci.yml" - - "dnsconfig.js" workflow_dispatch: @@ -44,11 +43,5 @@ jobs: env: GH_TOKEN: ${{ github.token }} - - name: Run DNSControl tests - if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js') - uses: is-a-dev/dnscontrol-action@main - with: - args: check - - name: Run tests run: npx ava tests/*.test.js --timeout=1m diff --git a/.github/workflows/dnscontrol.yml b/.github/workflows/dnscontrol.yml new file mode 100644 index 000000000..847aae8cb --- /dev/null +++ b/.github/workflows/dnscontrol.yml @@ -0,0 +1,25 @@ +name: DNSControl + +on: + push: + branches: [main] + paths: + - ".github/workflows/dnscontrol.yml" + - "dnsconfig.js" + + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-dnscontrol + cancel-in-progress: true + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: is-a-dev/dnscontrol-action@main + with: + args: check diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index e0891daae..415277fbe 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,12 +1,15 @@ -name: Pull Request Labeler +name: Label + on: schedule: - cron: "*/10 * * * *" + jobs: - labeler: + pull-requests: + name: Pull Requests runs-on: ubuntu-latest steps: - - uses: docker://docker.io/ilyam8/periodic-pr-labeler:v0.1.1 + - uses: ilyam8/periodic-pr-labeler@v0.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6094cba76..157d73bfc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,11 +22,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Run DNSControl tests - uses: is-a-dev/dnscontrol-action@main - with: - args: check - - name: Generate creds.json run: echo '{"cloudflare":{"TYPE":"CLOUDFLAREAPI","apitoken":"$CLOUDFLARE_API_TOKEN"}}' > ./creds.json diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index ad78c7b61..815d5ace0 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,12 +1,14 @@ -name: StaleBOT +name: Stale on: - workflow_dispatch: schedule: - - cron: "30 14 * * *" + - cron: "0 12 * * *" + + workflow_dispatch: jobs: - stale: + label: + name: Label runs-on: ubuntu-latest steps: - uses: actions/stale@v3 diff --git a/domains/_discord.thangle.json b/domains/_discord.thangle.json deleted file mode 100644 index ed21f0026..000000000 --- a/domains/_discord.thangle.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "owner": { - "username": "ThangLe9999", - "discord": "872078632565215282", - "OWL": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBLU9BRVAiLCJraWQiOiJaa1VsRmRqVThiUEstLXVVM2JJR09PVHFYYVFFS1ZINFVXOW53MTR6WTJnIn0.G5BtkuOaAUmFdixUP1IN4ZTmec-NZCllzsliK6q8sggJkBzasXefGfeEh6pBOiZ6ZkV2gr-GCdTN7LkP7QLPgLN6FglXac8BP1DSGDF3Lo8ULvrM-CpLUdeR0mqes6OQVvWdmPhZgVFGF3ItzDXQ7SqB6zrMbEWEwuZeg2KLHyPqvHsdrWLjzNpvVUwZRBuxicPyNTT70oMbPaOn3cvg4J_mVxNywnrIY5F34-T4tmiOEijsHmPwG2RzHsTCzC3cGYfNmokQtAsL0jhIMH4GzYdbTUsjDOrqbLdT-W2y33pQkeQuCjdf8KkeYCfacE0oWAZKFhrW2X0zJLYvGQBeuw.3qY1yT9H2x2WH2DePTziiw.PJvjWBGxfTgCKqZiHuAsRaUEdjld3XeMAw7NwX9P28VSFOS3-xsSiOvbLrCo1n1nTF-4g8EIRkkFJPn2P1T6YUDNuHVqbvnGg2wfhpfdSaM.yxghx67x9iGLMjDEKJdeAw" - }, - - "record": { - "TXT": "dh=8d98fb5fefbb1915e89d5dc43c9fdd9fa801557f" - } -} diff --git a/domains/angel.json b/domains/angel.json deleted file mode 100644 index 2b8a5383d..000000000 --- a/domains/angel.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "chewieleaf", - "email": "cchirrpy@outlook.com" - }, - "record": { - "TXT": "dh=440ef941b9b55391f86cf985e87ed861fc6e9512" - } -} diff --git a/domains/chewieleaf.json b/domains/chewieleaf.json deleted file mode 100644 index 699471137..000000000 --- a/domains/chewieleaf.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "owner": { - "username": "chewieleaf", - "email": "cchirrpy@outlook.com", - "discord": "898255050592366642" - }, - "record": { - "TXT": "dh=440ef941b9b55391f86cf985e87ed861fc6e9512" - } -} diff --git a/domains/exx.json b/domains/exx.json deleted file mode 100644 index 977561c23..000000000 --- a/domains/exx.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "xqxyzl", - "email": "exemailhelp+3@gmail.com" - }, - "record": { - "TXT": "_discord.exx.is-a.dev" - } -} diff --git a/domains/faultysden.json b/domains/faultysden.json deleted file mode 100644 index b2c3cdc94..000000000 --- a/domains/faultysden.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "owner": { - "username": "FaultyFaulty-glitch", - "email": "faultywindows+github@gmail.com", - "discord": "1041028534690386051" - }, - "record": { - "TXT": "google-site-verification=ix1jczu2q87igryc4eaexvdv1vrzjxolu14sjfpsnko" - } -} diff --git a/domains/interstellaros.json b/domains/interstellaros.json deleted file mode 100644 index cf559db57..000000000 --- a/domains/interstellaros.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "jacksoncraft859", - "email": "pollardjackson@outlook.com" - }, - "record": { - "TXT": "replit-verify=ac38945f-f53b-4b1b-980d-e2a1d64175c6" - } -} diff --git a/domains/thangle.json b/domains/thangle.json deleted file mode 100644 index f3b5eea08..000000000 --- a/domains/thangle.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "thangle9999", - "discord": "thangle9999" - }, - "record": { - "TXT": "vc-domain-verify=thangle.is-a.dev,bd6f80914ee2949ce900" - } -} diff --git a/tests/records.test.js b/tests/records.test.js index 52fb1f677..573e0604e 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -216,7 +216,10 @@ function validateRecordValues(t, data, file) { Number.isInteger(record.matchingType) && record.matchingType >= 0 && record.matchingType <= 255, `${file}: Invalid matchingType for ${key} at index ${idx}` ); - t.true(isValidHexadecimal(record.certificate), `${file}: Invalid certificate for ${key} at index ${idx}`); + t.true( + isValidHexadecimal(record.certificate), + `${file}: Invalid certificate for ${key} at index ${idx}` + ); } }); } @@ -310,3 +313,20 @@ t("All files should have valid record types", (t) => { t.pass(); }); + +t("Root subdomains should have at least one usable record", (t) => { + const usableRecordTypes = ["A", "AAAA", "CNAME", "MX", "NS", "URL"]; + + files.forEach((file) => { + const subdomain = file.replace(/\.json$/, ""); + if (subdomain.includes(".") || subdomain.startsWith("_")) return; + + const data = getDomainData(file); + const recordKeys = Object.keys(data.record); + + t.true( + usableRecordTypes.some((record) => recordKeys.includes(record)), + `${file}: Root subdomains must have at least one A, AAAA, CNAME, MX, NS, or URL record` + ); + }); +});