cigen vs dorny/paths-filter
paths-filter runs a job only when files matching a filter changed in the pull request or push. cigen skips a job only when its exact inputs already passed. Where each is the right tool.
dorny/paths-filter is the most popular way to skip GitHub Actions jobs by path. It’s free, MIT licensed, maintained (v4.0.3 in August 2026), and used by large projects. It answers “did files matching this filter change?” cigen answers “have this job’s exact inputs passed before?” The difference matters most when a check is required.
What paths-filter does
A step in a small first job sets one output per filter. Later jobs read the output with needs and if:
# fragment
jobs:
changes:
runs-on: ubuntu-latest
permissions: { pull-requests: read }
outputs:
backend: ${{ steps.filter.outputs.backend }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
backend:
- 'src/**'
test:
needs: changes
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
- run: make test
According to its README, it compares a pull request with its base branch (through the GitHub API), a feature-branch push
with its merge-base with a configured base branch, and a push to a long-lived branch with the most recent commit before
the push. It also supports merge queues, can list the matching files for later steps, and has every and
some-with-excludes matching modes (README).
Where paths-filter is the better choice
- It’s simple and free: one action, one small job, no binary to download, and nothing to store between runs. On a small repository with a few obvious areas, that’s often all you need.
- A job whose
if:is false never gets a runner. cigen on GitHub Actions still starts each job and skips its steps after the checkout (limits today), so today paths-filter saves more runner time per skipped job. list-fileshands the matching files to a linter or formatter, so a job can check only what changed. cigen doesn’t do test or file selection inside a job, and doesn’t plan to.- A job skipped by
if:reports “Success”, so it doesn’t leave a required check pending the way a workflow-levelpaths:filter does (GitHub’s docs).
Where cigen is safer
That “Success” is also the risk: a required job skipped by if: shows green, though it never tested this code. That’s
fine when the filter is right, and a false green when it isn’t:
- The filter lists what someone remembered when they wrote it. A test job also depends on its scripts, the lockfile, the toolchain pin, a shared config and the workflow file. If one of those isn’t in the filter, a change to it skips the job and the check still shows green. cigen adds those inputs itself: the job’s definition, the commands it uses, the scripts its steps name, and the root toolchain pins and lockfiles (derived inputs).
- On a push to
main, the filter compares with the previous commit. If the last run onmainfailed or was cancelled and the next commit doesn’t touch the filter’s paths, the job skips andmainturns green with nothing fixed. cigen records a pass only when the job succeeds, so a failure is retried until it passes. - The filter in the
changesjob and the job it guards live apart, and drift apart as the job grows. In cigen, a job’sinputssit beside its steps, and editing the job reruns it.
The same job in cigen
# cigen.yml
provider: github
workflows:
ci:
github:
on:
pull_request: {}
push: { branches: [main] }
jobs:
test:
image: ubuntu-latest
inputs: 'src/**'
steps:
- run: make test
make is opaque to cigen, so it can’t see which files the Makefile reads: list them in inputs, or check what cigen
derives with cigen hash --job test (CLI).
When to pick which
- paths-filter: a small repository; jobs that aren’t required checks; when you want the list of changed files for a linter; when not starting a runner at all matters more than catching an input you forgot.
- cigen: required checks that must mean “this exact code passed”; jobs whose inputs reach beyond one directory;
repos where a false green on
mainwould be expensive. - Both together: paths-filter for a coarse “is this area touched at all” decision, cigen for the jobs inside it.
What cigen can’t do yet
cigen is being rebuilt in the open. A skipped job still takes a runner and a checkout until the planned planner job
exists. Pass records live in the GitHub Actions cache: scoped by branch (a pull request can reuse main’s passes, not
the reverse) and expired after 7 days unused. The release install step needs v0.2.0, which isn’t out yet. See the
roadmap.