Repository navigation
fix(research): read GitHub Actions path filters from the workflow's on: triggers - #182
Merged
adityankale190895 merged 2 commits intoNov 18, 2026
Merged
Conversation
…n: triggers parseWorkflow looked for paths and paths-ignore on each job, where GitHub never puts them, so pathGlobs was undefined for every real workflow. Read on.<push|pull_request|pull_request_target>.paths, and only when every such trigger is filtered and the patterns are plain. Fixes DiffCI#177 Signed-off-by: FredApps <[email protected]>
This was referenced Nov 17, 2026
GitHub reads '**', '**.js' or 'src**' as crossing directories, but the planner's matcher turns a ** that is not next to a slash into *, so the task would only match top-level files and be marked a skip candidate for changes GitHub runs it for. Leave the filter unset for those patterns. Signed-off-by: FredApps <[email protected]>
FredApps
commented
Nov 17, 2026
FredApps
left a comment
Contributor
Author
There was a problem hiding this comment.
Cross-review at 9ee8835.
Checked:
- The trigger-level reading matches GitHub: a filter is used only when every push or pull_request trigger has one, and negated or non-plain patterns are dropped.
- The four new tests fail without the change.
analyzeCheckoutusesDefaultCIPlanner, so these globs are matched bysrc/planner/planner.ts.
Fixed:
PLAIN_GLOBaccepted'**','**.js'and'src**'. GitHub lets those cross directories, but the planner's matcher on main turns a**that isn't next to a slash into*. Apaths: ['**.js']workflow therefore only matched top-level files, and its task became SKIP_CANDIDATE forsrc/a.jschanges that GitHub runs it for.- 9ee8835 leaves the filter unset unless every
**is a whole path segment. A test covers'**','**.js','src**','{**,docs/*}'and'a/***', and checks that**/*.ts,api/**,a/**/band{api,web}/**are still kept.
All Actions jobs are green on 9ee8835. The external "DiffCI change impact" app check was still in progress when I posted this.
Open:
- Once #174 lands, the planner reads these
**forms the GitHub way and this guard could be relaxed. pathIgnoreGlobsis still unused, as noted.
FredApps
added a commit
to FredApps/core
that referenced
this pull request
Nov 18, 2026
…test so it merges cleanly with DiffCI#182 No change to the tests themselves. DiffCI#182 appends its path-filter tests at the end of the same describe block. Signed-off-by: FredApps <[email protected]>
FredApps
marked this pull request as ready for review
November 18, 2026 00:56
adityankale190895
pushed a commit
that referenced
this pull request
Nov 18, 2026
…es diffci plan (#171) * fix(research): an empty or comment-only workflow file no longer crashes diffci plan YAML.parse returns null for such a file, and parseWorkflow read .name from it, so analyzeCheckout threw for the whole repository. Fixes #168 Signed-off-by: FredApps <[email protected]> * test(research): place the empty-file cases before the malformed-file test so it merges cleanly with #182 No change to the tests themselves. #182 appends its path-filter tests at the end of the same describe block. Signed-off-by: FredApps <[email protected]> --------- Signed-off-by: FredApps <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #177
What changed
parseWorkflow(src/research/baseline/workflow-parser.ts) looked forpaths/paths-ignoreon each job (job.paths,job.on.paths). GitHub Actions only has them under the workflow's triggers, sopathGlobswasundefinedfor every real workflow, andbuildGenericTaskRegistryalways used the category defaults.The new
workflowPathFiltersreadson.<push|pull_request|pull_request_target>.pathsandpaths-ignore. It stays conservative:on: [push], or a barepush:next to a filteredpull_request:, runs the workflow for any change, so no filter is reported.!…) pattern, or any character outside[A-Za-z0-9_.@/*{},-], leaves the filter unset. The planner's matcher (src/planner/planner.ts, see Glob matcher passes regex metacharacters through: '+' throws, '(…)' and '?' mismatch, bare '**' misses nested paths #178) doesn't read?,[],(,+or!the way GitHub does, so those keep today's defaults.Regression tests
tests/research/baseline/workflow-parser.test.tsadds five tests: apull_request.pathsfilter, the union over push and pull_request,paths-ignore, the no-filter cases (unfiltered trigger, list or stringon:, negation, non-plain glob, dispatch only), and the registry using the filter as the task'sinputPatterns. Four of them fail onmain. The no-filter test passes before and after, as intended.Validation
npm run typecheck,npm testandnpm run audit:boundarypass.tests/analyze.test.tsandtests/planner/path-baseline.test.tsare unchanged and pass.Not covered
pathIgnoreGlobsis now filled in, butbuildGenericTaskRegistrystill doesn't use it. Wiring it in is a planner behavior change and is left out of this fix.