Summary
Add a detect-changes composite action that maps changed paths to named filters, so monorepo consumers can run only the CI jobs affected by a change. This is the monorepo enabler referenced by #168 §10 and is the most relevant of the dynamic-matrix pair (this + #29).
Scope decision (still relevant — yes): turbo-themes is a real multi-package monorepo consumer, so path-based change detection has a concrete adopter. Prefer evaluating a SHA-pinned dorny/paths-filter wrapped behind our action contract over hand-rolling git-diff logic; only build bespoke if the third-party action can't meet our egress/pinning policy.
Problem
Proposed Solution
.github/actions/detect-changes (wrapper around a pinned dorny/paths-filter, or bespoke fallback):
- uses: ./.github/actions/detect-changes
id: changes
with:
filters: |
frontend:
- 'packages/frontend/**'
- 'packages/shared/**'
backend:
- 'packages/backend/**'
docs:
- 'docs/**'
- '*.md'
- name: Test frontend
if: steps.changes.outputs.frontend == 'true'
run: bun run test --filter=frontend
Inputs
inputs:
filters: { description: 'YAML mapping of names to path patterns', required: true }
base: { description: 'Base ref (default: auto-detect)', required: false }
head: { description: 'Head ref', default: 'HEAD' }
token: { description: 'GitHub token', default: '\${{ github.token }}' }
Outputs
outputs:
changes: { description: 'JSON object of all filter results' }
# plus one boolean output per filter (e.g. frontend: 'true')
Implementation Notes
Benefits
References
Summary
Add a
detect-changescomposite action that maps changed paths to named filters, so monorepo consumers can run only the CI jobs affected by a change. This is the monorepo enabler referenced by #168 §10 and is the most relevant of the dynamic-matrix pair (this + #29).Problem
Proposed Solution
.github/actions/detect-changes(wrapper around a pinneddorny/paths-filter, or bespoke fallback):Inputs
Outputs
Implementation Notes
dorny/paths-filterpinned to a full SHA; expose our standard input contract and harden-runner/egress defaults around it.Benefits
References
dorny/paths-filter— candidate upstream to wrap