@mark1russell7/conventions 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,8 +54,9 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
54
54
  | `roadmap-parses` | Each call of the Pages workflow of the template (`reusable-pages.yml`) gives a `roadmap`, or `site-pages: false`. Without it, the Status page shows no item of the plan. Each roadmap that a workflow gives to the Status page (a `roadmap:` key) parses as `@mark1russell7/site-pages` reads it. The rule uses the parser of site-pages. Thus a pull request finds a bad row, and the Pages job on `main` does not stop on it. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
55
55
  | `runner-budget` | All repositories of the account share 40 runners. Each `strategy` with a `matrix` has a `max-parallel` of 3 or less. Each workflow has a concurrency group at the top or in each job. A job that calls a shared workflow of the option `grouped` gets its group from that workflow, and each job of that workflow has a group. The minute of each `cron` comes from a hash of the repository and the file (1 to 59), so the schedules of the repositories do not start together. The repository comes from `GITHUB_REPOSITORY` or from the remote `origin`. | fleet `runner-slots` (STRATEGY.md, 2026-10-30). |
56
56
  | `gate-trigger` | No workflow has `paths` or `paths-ignore` on `on.pull_request` or `on.pull_request_target`. The ruleset needs the summary check `<Name> OK` of each gate, and a workflow with a path filter does not start on each pull request. Then its check is not there, the ruleset cannot ask for it, and a pull request can merge before the gate ends. A gate uses the actions `changes` and `gate-summary` of the template (`CI.md`, "A gate with paths"). | fleet `gate-trigger` (STRATEGY.md, 2026-11-02). |
57
- | `license-file` | Each public package has a license field, and a license file with the same license in its own folder. A repository with a public package has a license file at its root. npm packs only the license file of the folder of the package, and GitHub reads only the one of the root: on 2026-11-02 five public repositories showed no license on GitHub while npm said MIT. `conventions fix` writes the missing files. | fleet strategy (2026-11-02). |
57
+ | `license-file` | Each public package has a license field, and a license file with the same license in its own folder. A public repository, or a repository with a public package, has a license file at its root. In a GitHub Actions run, the event file tells if the repository is public, and the option `license` (MIT by default) is the license of a root with no public package. npm packs only the license file of the folder of the package, and GitHub reads only the one of the root: on 2026-11-02 five public repositories showed no license on GitHub while npm said MIT. `conventions fix` writes the missing files. | fleet strategy (2026-11-02). |
58
58
  | `home-package` | A change does not add a function with a signature name of another home of the map (for example `median`, `mulberry32` or `writeFileAtomic`). A local copy drifts from the home and splits the fixes. On 2026-11-02 the fleet had 68 local statistics functions in 14 repositories. The rule examines only the lines that the change adds, so the copies that exist do not break. | fleet direction 18 (STRATEGY.md, 2026-11-02). |
59
+ | `pages-site` | A public repository has a workflow that calls the Pages workflow of the template (`mark1russell7/template/.github/workflows/reusable-pages.yml`, any ref), and the call deploys. A call with `deploy: false` makes a test site only. In a GitHub Actions run, the event file tells if the repository is public. Outside a run, the rule shows `skip`. On 2026-11-02 eight public repositories had no site with a Releases page and a Status page. | vex, crawler, client, coeval `pages.yml`. |
59
60
 
60
61
  The rule `release-files` needs the base of the change. On a pull request, the checkout is a merge commit, and the rule reads its two parents (`fetch-depth` 2 or more). In other runs, give `--base <ref>`. Without a base, the rule shows `skip`. The rule also needs each commit of the change. A shallow checkout can end inside the change. Then the authors and the messages that the rule reads are not those of the change, so the rule shows `error`. A pull request of one commit is complete at depth 2. For a longer one, the CI of the template deepens the checkout to the merge base.
61
62
 
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as runCli } from "./run-DPO3BOI4.js";
2
+ import { c as runCli } from "./run-CyH0BncB.js";
3
3
  // src/cli.ts
4
4
  try {
5
5
  process.exitCode = runCli(process.argv.slice(2), {
package/build/index.d.ts CHANGED
@@ -239,6 +239,11 @@ export declare function licenseFileOf(dir: string): string | undefined;
239
239
  export declare function authorOf(author: unknown): string | undefined;
240
240
  /** This function gives the text of the MIT license. */
241
241
  export declare function mitText(year: number, holder: string): string;
242
+ /**
243
+ * This function tells if the repository is public, from the event file of a GitHub Actions run. Outside a run, or with no
244
+ * field `repository.private` in the event, it gives undefined.
245
+ */
246
+ export declare function repositoryIsPublic(context: RuleContext): boolean | undefined;
242
247
  export declare const licenseFile: Rule;
243
248
  /** The compare of two real paths. It is true through a link too, and it works on each Node version. */
244
249
  export declare const REAL_COMPARE = "process.argv[1] !== undefined && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))";
@@ -251,6 +256,16 @@ export declare const DEFAULT_ALLOWED: readonly string[];
251
256
  /** The forms of a home folder: Windows, macOS and Linux. The group `user` is the name of the user. */
252
257
  export declare const HOME_PATTERNS: readonly RegExp[];
253
258
  export declare const noLocalPaths: Rule;
259
+ /** The Pages workflow of the template, as a call from another repository and as a call from the template itself. */
260
+ export declare const PAGES_WORKFLOWS: readonly string[];
261
+ /** A call of the Pages workflow: its line (from 1), and false when its job sets `deploy: false`. */
262
+ interface PagesCall {
263
+ readonly line: number;
264
+ readonly deploys: boolean;
265
+ }
266
+ /** This function gives each call of a workflow of `workflows` in the text of a workflow file. The ref after `@` can be any ref. */
267
+ export declare function pagesCalls(text: string, workflows?: readonly string[]): PagesCall[];
268
+ export declare const pagesSite: Rule;
254
269
  /** This function tells if a specifier gets the package from git, not from a registry or the workspace. */
255
270
  export declare function isGitSpecifier(spec: string): boolean;
256
271
  /**
@@ -399,5 +414,5 @@ export declare function workspaceGlobs(root: string): string[] | undefined;
399
414
  * The result has absolute paths, in the order of the code units.
400
415
  */
401
416
  export declare function packageFolders(root: string, globs?: readonly string[] | undefined): string[];
402
- export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeState, Manifest, OptionSpec, OptionValue, Options, PackageInfo, PathFilter, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult };
417
+ export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeState, Manifest, OptionSpec, OptionValue, Options, PackageInfo, PagesCall, PathFilter, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult };
403
418
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;EAC1C,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UCr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wBAmChB,UACd,SAAS,SAAS,0BAClB,cACA,OAAM;qBAkRK,YAAY;qBC/VZ,cAAc;;qBC3Bd;;qBAGA;qBA6DA,aAAa;qBCnEb,mBAAmB;;qBCiBnB,gBAAgB;;qBCvBhB,cAAc,SAAS;WAA0B;WAA0B;;;UCYvE;WACN;WACA;WACA;;WAEA;WACA,iBAAiB;;WAEjB;;WAEA;;;UAIM;WACN,gBAAgB;;WAEhB;;;UAIM;;WAEN;;WAEA;;WAEA;WACA,MAAM,SAAS;;WAEf,iBAAiB;;;wBAaZ,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,gCAAqC;;wBAwB1G,UAAU,SAAS,eAAe;;UA2CjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6BG,OAAO,yBAAyB,IAAI;;;;;;wBC1RpC,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src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AEhB;;;UAIM;;WAEN;;WAEA;;WAEA;WACA,MAAM,SAAS;;WAEf,iBAAiB;;;wBAaZ,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,gCAAqC;;wBAwB1G,UAAU,SAAS,eAAe;;UA2CjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6BG,OAAO,yBAAyB,IAAI;;;;;;wBC1RpC,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
package/build/index.js CHANGED
@@ -1 +1 @@
1
- export { st as ACTIONS_COMMIT, I as DEFAULT_ALLOWED, mt as DEPENDENCY_FIELDS, $ as HOMES, ot as HOME_EXPORTS, L as HOME_PATTERNS, p as IGNORE_AFTER, U as LICENSE_TEXTS, et as MAP_RULE, B as REAL_COMPARE, d as RULES, ft as STRICT_OPTIONS, m as TRAIN_SCOPES, t as USAGE, n as annotations, W as authorOf, ht as cleanPath, gt as codePackages, _ as configsOfScript, ct as convertGate, r as createContext, pt as cuePreset, J as declaredName, jt as defaultOptions, tt as findHomes, i as formatResult, lt as gateTrigger, Dt as globFolders, Ot as globToRegExp, _t as hasFile, V as hasImportMetaMain, x as hasTests, Y as homePackage, vt as inFolder, N as isGitSpecifier, P as isPinned, C as isSourcePath, yt as keyLine, G as licenseFile, K as licenseFileOf, bt as lineOf, a as listRules, H as mainCheck, nt as mapMarkdown, rt as mapText, xt as matchesAny, it as mergeHomes, X as messageOf, q as mitText, z as noBuildOutput, R as noLocalPaths, kt as packageFolders, Mt as parseConfig, St as parseJsonc, w as pathsOf, F as pinnedGitDeps, ut as prPathFilters, o as readConfig, Ct as readJsonc, at as readOverlay, M as releaseFiles, wt as replaceLine, Z as repoOf, E as repositoryOfRemote, j as requiredScripts, k as roadmapOfLine, A as roadmapParses, s as runChecks, c as runCli, l as runFix, Tt as runGit, D as runnerBudget, O as scheduleMinute, v as scriptsOf, Q as signaturesOf, T as sourceMain, Et as specifiersOf, u as summaryMarkdown, dt as summaryName, b as testsRequired, h as trustPolicy, S as tsconfigTest, y as typedFiles, g as typedScripts, At as workspaceGlobs, f as workspaceProtocol } from "./run-DPO3BOI4.js";
1
+ export { dt as ACTIONS_COMMIT, z as DEFAULT_ALLOWED, vt as DEPENDENCY_FIELDS, rt as HOMES, ut as HOME_EXPORTS, B as HOME_PATTERNS, p as IGNORE_AFTER, K as LICENSE_TEXTS, it as MAP_RULE, I as PAGES_WORKFLOWS, U as REAL_COMPARE, d as RULES, gt as STRICT_OPTIONS, m as TRAIN_SCOPES, t as USAGE, n as annotations, q as authorOf, yt as cleanPath, bt as codePackages, _ as configsOfScript, ft as convertGate, r as createContext, _t as cuePreset, Q as declaredName, Ft as defaultOptions, at as findHomes, i as formatResult, pt as gateTrigger, jt as globFolders, Mt as globToRegExp, xt as hasFile, W as hasImportMetaMain, x as hasTests, $ as homePackage, St as inFolder, N as isGitSpecifier, P as isPinned, C as isSourcePath, Ct as keyLine, J as licenseFile, Y as licenseFileOf, wt as lineOf, a as listRules, G as mainCheck, ot as mapMarkdown, st as mapText, Tt as matchesAny, ct as mergeHomes, et as messageOf, X as mitText, H as noBuildOutput, V as noLocalPaths, Nt as packageFolders, L as pagesCalls, R as pagesSite, It as parseConfig, Et as parseJsonc, w as pathsOf, F as pinnedGitDeps, mt as prPathFilters, o as readConfig, Dt as readJsonc, lt as readOverlay, M as releaseFiles, Ot as replaceLine, tt as repoOf, Z as repositoryIsPublic, E as repositoryOfRemote, j as requiredScripts, k as roadmapOfLine, A as roadmapParses, s as runChecks, c as runCli, l as runFix, kt as runGit, D as runnerBudget, O as scheduleMinute, v as scriptsOf, nt as signaturesOf, T as sourceMain, At as specifiersOf, u as summaryMarkdown, ht as summaryName, b as testsRequired, h as trustPolicy, S as tsconfigTest, y as typedFiles, g as typedScripts, Pt as workspaceGlobs, f as workspaceProtocol } from "./run-CyH0BncB.js";
@@ -6593,11 +6593,25 @@ SOFTWARE.
6593
6593
  `;
6594
6594
  }
6595
6595
  const isPublic = (pkg) => pkg.manifest["private"] !== true;
6596
+ /**
6597
+ * This function tells if the repository is public, from the event file of a GitHub Actions run. Outside a run, or with no
6598
+ * field `repository.private` in the event, it gives undefined.
6599
+ */
6600
+ function repositoryIsPublic(context) {
6601
+ const file = context.env["GITHUB_EVENT_PATH"];
6602
+ if (file === void 0 || file === "" || !existsSync(file)) return void 0;
6603
+ try {
6604
+ const event = JSON.parse(readFileSync(file, "utf8"));
6605
+ return typeof event.repository?.private === "boolean" ? !event.repository.private : void 0;
6606
+ } catch {
6607
+ return;
6608
+ }
6609
+ }
6596
6610
  const licenseFile = {
6597
6611
  id: "license-file",
6598
- title: "Each public package has a license field and, in its own folder, a license file with the same license. A repository with a public package has a license file at its root.",
6612
+ title: "Each public package has a license field and, in its own folder, a license file with the same license. A public repository, or a repository with a public package, has a license file at its root.",
6599
6613
  reason: "npm packs the license file of the folder of the package only, and GitHub reads the license file of the root only. On 2026-11-02 five public repositories (packing, rigor, layout-contract, typeset, template) had no license file at the root, so GitHub showed them as without a license while their packages on npm said MIT.",
6600
- fix: "Add a license field to package.json (MIT is the license of each package of the fleet). `conventions fix` writes each missing license file: a copy of a license file of the repository with the same license, or else the MIT text with the author of the manifest. Correct a license file whose text is not the license of the field.",
6614
+ fix: "Add a license field to package.json (the option `license`, MIT by default, is the license of the root of a public repository with no public package). `conventions fix` writes each missing license file: a copy of a license file of the repository with the same license, or else the MIT text with the author of the manifest. Correct a license file whose text is not the license of the field.",
6601
6615
  sources: [
6602
6616
  "vex",
6603
6617
  "coeval",
@@ -6608,12 +6622,17 @@ const licenseFile = {
6608
6622
  rule: "license-file",
6609
6623
  doc: "LICENSE (MIT, at the root, with license MIT in each package.json)"
6610
6624
  })),
6611
- options: {},
6612
- check(context) {
6625
+ options: { license: {
6626
+ type: "string",
6627
+ default: "MIT",
6628
+ description: "The license of the root of a public repository with no public package."
6629
+ } },
6630
+ check(context, options) {
6613
6631
  const all = [context.rootPackage, ...codePackages(context)];
6614
6632
  const unique = all.filter((pkg, index) => all.findIndex((other) => other.file === pkg.file) === index);
6615
6633
  const published = unique.filter(isPublic);
6616
- if (published.length === 0) return [];
6634
+ const publicRepo = repositoryIsPublic(context) === true;
6635
+ if (published.length === 0 && !publicRepo) return [];
6617
6636
  const breaks = [];
6618
6637
  const texts = /* @__PURE__ */ new Map();
6619
6638
  const licenseOf = (pkg) => typeof pkg.manifest["license"] === "string" ? pkg.manifest["license"] : void 0;
@@ -6663,7 +6682,7 @@ const licenseFile = {
6663
6682
  }
6664
6683
  }
6665
6684
  if (!published.includes(context.rootPackage) && licenseFileOf(context.root) === void 0) {
6666
- const license = published.map(licenseOf).find((item) => item !== void 0);
6685
+ const license = published.map(licenseOf).find((item) => item !== void 0) ?? (publicRepo ? String(options["license"]) : void 0);
6667
6686
  if (license !== void 0) missing("", license, published[0]?.manifest["author"], "GitHub reads only the license file of the root.");
6668
6687
  }
6669
6688
  return breaks;
@@ -7025,6 +7044,68 @@ const noLocalPaths = {
7025
7044
  return breaks;
7026
7045
  }
7027
7046
  };
7047
+ // src/rules/pages-site.ts
7048
+ /**
7049
+ * The rule `pages-site`: a public repository has a site. A workflow uses the Pages workflow of the template, and the
7050
+ * call deploys.
7051
+ */
7052
+ /** The Pages workflow of the template, as a call from another repository and as a call from the template itself. */
7053
+ const PAGES_WORKFLOWS = ["mark1russell7/template/.github/workflows/reusable-pages.yml", "./.github/workflows/reusable-pages.yml"];
7054
+ /** This function gives each call of a workflow of `workflows` in the text of a workflow file. The ref after `@` can be any ref. */
7055
+ function pagesCalls(text, workflows = PAGES_WORKFLOWS) {
7056
+ const lines = workflowLines(text);
7057
+ const names = new Set(workflows.map((name) => name.toLowerCase()));
7058
+ const calls = [];
7059
+ lines.forEach((line, index) => {
7060
+ const uses = keyValue(line, "uses");
7061
+ if (uses === void 0 || !names.has((uses.split("@")[0] ?? "").toLowerCase())) return;
7062
+ let job = index - 1;
7063
+ while (job >= 0 && ((lines[job] ?? "").trim() === "" || indentOf$1(lines[job] ?? "") >= indentOf$1(line))) job -= 1;
7064
+ const body = job < 0 ? [line] : lines.slice(job, blockEnd(lines, job));
7065
+ calls.push({
7066
+ line: index + 1,
7067
+ deploys: !body.some((text) => keyValue(text, "deploy") === "false")
7068
+ });
7069
+ });
7070
+ return calls;
7071
+ }
7072
+ const pagesSite = {
7073
+ id: "pages-site",
7074
+ title: "A public repository has a workflow that calls the Pages workflow of the template (`reusable-pages.yml`, any ref), and the call deploys.",
7075
+ reason: "Each public project has a site with its Releases page and its Status page, so a reader sees the versions and the open work. On 2026-11-02 eight public repositories had no site: typeset, algebra, headroom, release-train, optional, ste-lint, lag-hud and template.",
7076
+ fix: "Add `.github/workflows/pages.yml` with a job `uses: mark1russell7/template/.github/workflows/reusable-pages.yml@<commit> # main` and the permissions of CI.md (\"Pages\"). Give `build`, `out` and `roadmap: docs/ROADMAP.md`. After the build, the job starts `site-pages build`, which adds the Releases page and the Status page. Then set the Pages source to \"GitHub Actions\": `gh api -X POST repos/<owner>/<repo>/pages -f build_type=workflow`.",
7077
+ sources: [
7078
+ "vex",
7079
+ "crawler",
7080
+ "client",
7081
+ "coeval"
7082
+ ].map((repo) => ({
7083
+ repo,
7084
+ rule: "pages-site",
7085
+ doc: ".github/workflows/pages.yml (a call of reusable-pages.yml of the template)"
7086
+ })),
7087
+ options: { workflows: {
7088
+ type: "strings",
7089
+ default: PAGES_WORKFLOWS,
7090
+ description: "The workflows that deploy a site, without the ref after `@`."
7091
+ } },
7092
+ check(context, options) {
7093
+ const visible = repositoryIsPublic(context);
7094
+ if (visible === void 0) return { skipped: "outside a GitHub Actions run, the rule cannot tell if the repository is public" };
7095
+ if (!visible) return [];
7096
+ const files = context.gitFiles();
7097
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
7098
+ const calls = files.filter((path) => WORKFLOW$1.test(path)).sort(byCode).flatMap((file) => pagesCalls(readFileSync(join(context.root, file), "utf8"), options["workflows"]).map((call) => ({
7099
+ file,
7100
+ ...call
7101
+ })));
7102
+ if (calls.some((call) => call.deploys)) return [];
7103
+ return [{
7104
+ file: ".github/workflows/pages.yml",
7105
+ message: `The repository is public, and no workflow deploys its site with the Pages workflow of the template.${calls.length === 0 ? "" : ` The calls in ${[...new Set(calls.map((call) => call.file))].join(", ")} have deploy: false.`}`
7106
+ }];
7107
+ }
7108
+ };
7028
7109
  // src/rules/pinned-git-deps.ts
7029
7110
  /**
7030
7111
  * The rule `pinned-git-deps`: a dependency from git names a full commit.
@@ -9337,7 +9418,8 @@ const RULES = [
9337
9418
  runnerBudget,
9338
9419
  gateTrigger,
9339
9420
  homePackage,
9340
- licenseFile
9421
+ licenseFile,
9422
+ pagesSite
9341
9423
  ];
9342
9424
  // src/run.ts
9343
9425
  /**
@@ -9733,6 +9815,6 @@ function runMap(args, io) {
9733
9815
  else io.stdout(mapText(found));
9734
9816
  return 0;
9735
9817
  }
9736
- export { HOMES as $, roadmapParses as A, workspaceGlobs as At, REAL_COMPARE as B, isSourcePath as C, readJsonc as Ct, runnerBudget as D, globFolders as Dt, repositoryOfRemote as E, specifiersOf as Et, pinnedGitDeps as F, licenseFile as G, mainCheck as H, DEFAULT_ALLOWED as I, declaredName as J, licenseFileOf as K, HOME_PATTERNS as L, releaseFiles as M, parseConfig as Mt, isGitSpecifier as N, scheduleMinute as O, globToRegExp as Ot, isPinned as P, signaturesOf as Q, noLocalPaths as R, tsconfigTest as S, parseJsonc as St, sourceMain as T, runGit as Tt, LICENSE_TEXTS as U, hasImportMetaMain as V, authorOf as W, messageOf as X, homePackage as Y, repoOf as Z, configsOfScript as _, hasFile as _t, listRules as a, readOverlay as at, testsRequired as b, lineOf as bt, runCli as c, convertGate as ct, RULES as d, summaryName as dt, MAP_RULE as et, workspaceProtocol as f, STRICT_OPTIONS as ft, typedScripts as g, codePackages as gt, trustPolicy as h, cleanPath as ht, formatResult as i, mergeHomes as it, requiredScripts as j, defaultOptions as jt, roadmapOfLine as k, packageFolders as kt, runFix as l, gateTrigger as lt, TRAIN_SCOPES as m, DEPENDENCY_FIELDS as mt, annotations as n, mapMarkdown as nt, readConfig as o, HOME_EXPORTS as ot, IGNORE_AFTER as p, cuePreset as pt, mitText as q, createContext as r, mapText as rt, runChecks as s, ACTIONS_COMMIT as st, USAGE as t, findHomes as tt, summaryMarkdown as u, prPathFilters as ut, scriptsOf as v, inFolder as vt, pathsOf as w, replaceLine as wt, hasTests as x, matchesAny as xt, typedFiles as y, keyLine as yt, noBuildOutput as z };
9818
+ export { homePackage as $, roadmapParses as A, specifiersOf as At, HOME_PATTERNS as B, isSourcePath as C, keyLine as Ct, runnerBudget as D, readJsonc as Dt, repositoryOfRemote as E, parseJsonc as Et, pinnedGitDeps as F, defaultOptions as Ft, mainCheck as G, noBuildOutput as H, PAGES_WORKFLOWS as I, parseConfig as It, licenseFile as J, LICENSE_TEXTS as K, pagesCalls as L, releaseFiles as M, globToRegExp as Mt, isGitSpecifier as N, packageFolders as Nt, scheduleMinute as O, replaceLine as Ot, isPinned as P, workspaceGlobs as Pt, declaredName as Q, pagesSite as R, tsconfigTest as S, inFolder as St, sourceMain as T, matchesAny as Tt, REAL_COMPARE as U, noLocalPaths as V, hasImportMetaMain as W, mitText as X, licenseFileOf as Y, repositoryIsPublic as Z, configsOfScript as _, cuePreset as _t, listRules as a, findHomes as at, testsRequired as b, codePackages as bt, runCli as c, mergeHomes as ct, RULES as d, ACTIONS_COMMIT as dt, messageOf as et, workspaceProtocol as f, convertGate as ft, typedScripts as g, STRICT_OPTIONS as gt, trustPolicy as h, summaryName as ht, formatResult as i, MAP_RULE as it, requiredScripts as j, globFolders as jt, roadmapOfLine as k, runGit as kt, runFix as l, readOverlay as lt, TRAIN_SCOPES as m, prPathFilters as mt, annotations as n, signaturesOf as nt, readConfig as o, mapMarkdown as ot, IGNORE_AFTER as p, gateTrigger as pt, authorOf as q, createContext as r, HOMES as rt, runChecks as s, mapText as st, USAGE as t, repoOf as tt, summaryMarkdown as u, HOME_EXPORTS as ut, scriptsOf as v, DEPENDENCY_FIELDS as vt, pathsOf as w, lineOf as wt, hasTests as x, hasFile as xt, typedFiles as y, cleanPath as yt, DEFAULT_ALLOWED as z };
9737
9819
 
9738
- //# sourceMappingURL=run-DPO3BOI4.js.map
9820
+ //# sourceMappingURL=run-CyH0BncB.js.map