summaryrefslogtreecommitdiff
path: root/tools/lint.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-01 11:11:32 -0500
committerGitHub <noreply@github.com>2024-03-01 11:11:32 -0500
commit7ac040833025bf234dec485ddaa6c459b25d2196 (patch)
tree82f036bd96100575ab17d1616b55d54b5d21a1df /tools/lint.js
parent878384aefaafacb2dc875ba1d7ea9d4af01d2cf0 (diff)
ci: actually fix workflow permissions (#22644)
Also adds a lint to ensure this file is kept up to date.
Diffstat (limited to 'tools/lint.js')
-rwxr-xr-xtools/lint.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/tools/lint.js b/tools/lint.js
index 14567ed1d..56662fdd8 100755
--- a/tools/lint.js
+++ b/tools/lint.js
@@ -2,6 +2,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
import { checkCopyright } from "./copyright_checker.js";
+import * as ciFile from "../.github/workflows/ci.generate.ts";
const promises = [];
@@ -12,17 +13,18 @@ if (!js && !rs) {
rs = true;
}
-if (js) {
- promises.push(dlint());
- promises.push(dlintPreferPrimordials());
-}
-
if (rs) {
promises.push(clippy());
}
-if (js && rs) {
- promises.push(checkCopyright());
+if (js) {
+ promises.push(dlint());
+ promises.push(dlintPreferPrimordials());
+ promises.push(ensureCiYmlUpToDate());
+
+ if (rs) {
+ promises.push(checkCopyright());
+ }
}
const results = await Promise.allSettled(promises);
@@ -164,3 +166,13 @@ async function clippy() {
throw new Error("clippy failed");
}
}
+
+async function ensureCiYmlUpToDate() {
+ const expectedCiFileText = ciFile.generate();
+ const actualCiFileText = await Deno.readTextFile(ciFile.CI_YML_URL);
+ if (expectedCiFileText !== actualCiFileText) {
+ throw new Error(
+ "./.github/workflows/ci.yml is out of date. Run: ./.github/workflows/ci.generate.ts",
+ );
+ }
+}