From 4a0c4afb21017b5bd86cd770a8c8e41f8d1f6503 Mon Sep 17 00:00:00 2001 From: David Edey Date: Wed, 13 May 2026 12:49:47 +0000 Subject: [PATCH] fix: pass dot:true to minimatch in subproject path matching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns the checkgroup subproject matcher with GitHub Actions' own `paths:` filter, which uses minimatch with `dot: true`. Without it, patterns like `**` silently fail to match paths containing dot- prefixed segments — so a subproject keyed on `paths: ["**"]` won't activate for a PR that only modifies files under `.github/` or similar dot directories, even though the intent of `**` is "match everything". Co-Authored-By: Claude Opus 4.7 (1M context) --- dist/check-group/core/subproj_matching.js | 7 ++++++- src/check-group/core/subproj_matching.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/check-group/core/subproj_matching.js b/dist/check-group/core/subproj_matching.js index 16cb8b821..8695f6b54 100644 --- a/dist/check-group/core/subproj_matching.js +++ b/dist/check-group/core/subproj_matching.js @@ -21,7 +21,12 @@ var matchFilenamesToSubprojects = function (filenames, subprojConfigs) { // https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths var isNegation = path.startsWith("!"); // https://www.npmjs.com/package/minimatch - var matches = minimatch_1.default.match(filenames, path, { "flipNegate": isNegation }); + // `dot: true` aligns with GitHub Actions' own `paths:` filter, which uses + // minimatch with the same option — without it, patterns like `**` would + // silently fail to match paths containing dot-prefixed segments (e.g. + // `.github/foo` or `my-project/.env.staging`), causing subprojects to + // appear inactive for PRs that touch only such paths. + var matches = minimatch_1.default.match(filenames, path, { "flipNegate": isNegation, "dot": true }); // if it's a negation, delete from the list of hits, otherwise add matches.forEach(function (match) { return (isNegation) ? hits.delete(match) : hits.add(match); }); }); diff --git a/src/check-group/core/subproj_matching.ts b/src/check-group/core/subproj_matching.ts index f7f7072f4..484b63dea 100644 --- a/src/check-group/core/subproj_matching.ts +++ b/src/check-group/core/subproj_matching.ts @@ -21,7 +21,12 @@ export const matchFilenamesToSubprojects = ( // https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths const isNegation = path.startsWith("!") // https://www.npmjs.com/package/minimatch - const matches = minimatch.match(filenames, path, {"flipNegate": isNegation}) + // `dot: true` aligns with GitHub Actions' own `paths:` filter, which uses + // minimatch with the same option — without it, patterns like `**` would + // silently fail to match paths containing dot-prefixed segments (e.g. + // `.github/foo` or `my-project/.env.staging`), causing subprojects to + // appear inactive for PRs that touch only such paths. + const matches = minimatch.match(filenames, path, {"flipNegate": isNegation, "dot": true}) // if it's a negation, delete from the list of hits, otherwise add matches.forEach((match: string) => (isNegation) ? hits.delete(match): hits.add(match)) });