This commit is contained in:
William Harrison committed 2025-01-02 18:54:05 +08:00
1 parent b7739fb0c8
commit f78a7beddc
3 files changed
+23 -26

No files matched your search

+6 -3
View File
@@ -1,5 +1,3 @@
if (!process.env.PULL_REQUEST) return;
const t = require("ava");
const fs = require("fs-extra");
const path = require("path");
@@ -12,12 +10,17 @@ const domainsPath = path.resolve("domains");
const admins = require("../util/administrators.json");
t("Modified JSON files must be owned by the PR author", (t) => {
if(process.env.EVENT !== "pull_request") {
t.pass();
return;
}
MODIFIED_FILES.forEach((file) => {
const domain = fs.readJsonSync(path.join(domainsPath, file));
t.true(
domain.owner.username === PR_AUTHOR || admins.includes(PR_AUTHOR),
`${file}: Owner should be ${PR_AUTHOR} but is ${domain.owner}`
`${file}: Owner is ${domain.owner.username} but ${PR_AUTHOR} is the PR author`
);
});
});