This directory contains examples and fixtures for testing the conditional-paths-action locally using act.
simple/- Basic usage examples with single filtersmonorepo/- Advanced monorepo filtering with complex patternsfixtures/- Sample repository structures and test payloadsevents/- GitHub webhook payloads for testing different triggers
-
Install act:
# macOS brew install act # Linux/WSL curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
-
Build the action:
pnpm install pnpm run build pnpm run package
Test simple filter patterns:
act -W .github/workflows/examples/simple-usage.yml -j test-simple-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04Test complex monorepo scenarios:
act -W .github/workflows/examples/monorepo-usage.yml -j test-monorepo-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04Test multiple configurations:
act -W .github/workflows/examples/matrix-usage.yml -P ubuntu-latest=catthehacker/ubuntu:act-22.04Test with PR context:
act -W .github/workflows/examples/pr-simulation.yml -j test-pr-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04 --eventpath examples/events/pull-request.jsonfrontend:
- 'frontend/**'
- 'shared/**'
- 'package.json'
backend:
- 'backend/**'
- 'shared/**'
- 'Dockerfile'new-features:
- added: 'src/**/*.ts'
- added: 'features/**'
bug-fixes:
- modified: 'src/**/*.ts'
- modified: 'lib/**/*.js'
cleanup:
- deleted: '**/*'typescript:
- '**/*.ts'
- '**/*.tsx'
- 'tsconfig*.json'
python:
- '**/*.py'
- 'requirements*.txt'
- 'pyproject.toml'
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'act -W .github/workflows/examples/simple-usage.yml -j test-simple-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04 -vact -W .github/workflows/examples/simple-usage.yml -j test-simple-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04 --stepact -W .github/workflows/examples/pr-simulation.yml -j test-pr-filters -P ubuntu-latest=catthehacker/ubuntu:act-22.04 --eventpath examples/events/custom-payload.json- Create a filter file in
examples/custom/ - Copy one of the example workflows to
.github/workflows/examples/ - Update the workflow to use your filter file
- Run with act:
act -W .github/workflows/examples/your-workflow.yml -j your-job -P ubuntu-latest=catthehacker/ubuntu:act-22.04