Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function collectRecords(domain) {
for (const [type, value] of Object.entries(recs)) {
const values = Array.isArray(value) ? value : [value];
for (const v of values) {
if (typeof v !== "string" && typeof v !== "number") {
throw new Error(`${domain}: ${sub}/${file} ${type} value must be a string, got ${JSON.stringify(v)}`);
}
records.push({ name, type, data: String(v) });
}
}
Expand All @@ -67,6 +70,7 @@ function summarize(text) {
}

async function deployZone(domain, productId) {
// Throws on malformed files, so a broken zone is never pushed.
const records = collectRecords(domain);
const body = JSON.stringify({ productId, records });

Expand Down
9 changes: 8 additions & 1 deletion .github/scripts/validate-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ module.exports = async function validate({ github, context, core }) {

// 5) Validate the folder name (and the record label, unless it is the apex).
const nameErrors = validateName(sub);
if (!isApex) nameErrors.push(...validateName(label));
// Record labels may start with "_" (e.g. `_railway-verify` for TXT verification).
if (!isApex) nameErrors.push(...validateName(label.replace(/^_/, "")));
if (nameErrors.length) {
errors.push(...nameErrors.map((e) => `\`${fqdn}\`: ${e}`));
continue;
Expand Down Expand Up @@ -248,6 +249,12 @@ function validateContent(data, isApex) {
errors.push(`unsupported record type \`${t}\` (allowed: ${ALLOWED_RECORD_TYPES.join(", ")})`);
}
}
for (const [t, value] of Object.entries(data.records)) {
const values = Array.isArray(value) ? value : [value];
if (values.length === 0 || values.some((v) => typeof v !== "string" || v.trim() === "")) {
errors.push(`\`${t}\` must be a string or a list of strings (for a record on another name like \`_verify\`, add a separate \`_verify.json\` file)`);
}
}
if (types.includes("CNAME") && types.length > 1) {
errors.push("a `CNAME` record cannot be combined with other record types");
}
Expand Down
19 changes: 8 additions & 11 deletions domains/skillissue.gg/aurora/@.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"records": {
"CNAME": "supernova-production-effe.up.railway.app",
"TXT": {
"_railway-verify": "railway-verify=5be397286a026674475780f7826aa5bf67ecff58f9156e09068c55d5b0fb34b3"
}
},
"description": "SUPERNOVA aurora-themed cosmic apparel",
"owner": {
"github": "userst971-gif"
}
}
"records": {
"CNAME": "supernova-production-effe.up.railway.app"
},
"description": "SUPERNOVA aurora-themed cosmic apparel",
"owner": {
"github": "userst971-gif"
}
}
5 changes: 5 additions & 0 deletions domains/skillissue.gg/aurora/_railway-verify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"records": {
"TXT": "railway-verify=5be397286a026674475780f7826aa5bf67ecff58f9156e09068c55d5b0fb34b3"
}
}
Loading