Skip to content
Merged
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
10 changes: 8 additions & 2 deletions scripts/fleet-audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,19 @@ function jobPart(context: string): string {
return name.includes(" / ") ? name.slice(name.lastIndexOf(" / ") + 3) : name;
}

const hookRecipes = ["fmt", "fmt-check", "lint", "typecheck", "test", "secrets", "privacy", "hooks"];
// Hook recipes from C7.5 and C7.10, plus `check` (C7.5: the aggregate of the
// recipes CI requires) and common display aliases (`Format`, `Types`).
const hookRecipes = [
"fmt", "fmt-check", "format", "lint", "typecheck", "types", "test", "secrets", "privacy", "hooks",
"check", "workflows", "shellcheck", "agent-files", "forbidden-files",
];
const hookRecipePattern = new RegExp(`^(${hookRecipes.join("|")})[\\s(]`);

function isHookRecipe(context: string): boolean {
const name = jobPart(context).toLowerCase();
if (hookRecipes.includes(name)) return true;
// A matrix or shard suffix keeps the recipe: `test (unit)`, `fmt fast`.
return /^(fmt|fmt-check|lint|typecheck|test|secrets|privacy|hooks)[\s(]/.test(name);
return hookRecipePattern.test(name);
}

// The owner standard's `## CI-only required checks` section names the required
Expand Down