Skip to content

feat(actions): add monorepo support with path-based change detection #36

@TurboCoder13

Description

@TurboCoder13

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD infrastructureenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions