Update pr.test.js

This commit is contained in:
William Harrison committed 2025-01-02 20:33:54 +08:00
1 parent 55b60ba3f7
commit 759001598c
1 file changed
+4 -2
+4 -2
View File
@@ -3,7 +3,7 @@ const fs = require("fs-extra");
const path = require("path");
const PR_AUTHOR = process.env.PR_AUTHOR;
const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map(file => file.replace(/^domains\//, ""));
const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map((file) => file.replace(/^domains\//, ""));
const EVENT = process.env.EVENT;
const RUN_ID = process.env.RUN_ID;
@@ -47,9 +47,11 @@ t("New JSON files must be owned by the PR author", async (t) => {
if (EVENT !== "pull_request") return t.pass();
const headDomainsFiles = fs.readdirSync(headDomainsPath);
const newFiles = domainsPath.filter((file) => !fs.existsSync(path.join(headDomainsFiles, file)));
console.log(newFiles);
await Promise.all(
newFiles.map(async (file) => {
const domain = await getFileContent(domainsPath, file);