Compare

cigen vs GitHub Actions path filters

on: push: paths: decides whether a whole workflow runs from the files a push changed. cigen decides per job, from whether that job's inputs already passed. When each fits.

GitHub Actions paths and paths-ignoreChecked against its docs on 2026-12-04

GitHub’s paths and paths-ignore filters are the first thing most people reach for when CI runs too much. They’re built in, cost nothing and take one line. They decide whether a whole workflow starts, from the files a push or pull request changed. cigen decides whether each job needs to run, from whether that job’s exact inputs have already passed.

What path filters do

# fragment
on:
  pull_request:
    paths: ['src/**', 'Cargo.lock']

When a pull request changes no file matching src/** or Cargo.lock, the workflow doesn’t run at all. GitHub works out the changed files with a three-dot diff for pull requests (everything on the branch since it left the base) and a two-dot diff for pushes (the new head against the previous one) (GitHub’s workflow syntax docs).

Where path filters are the better choice

  • There’s nothing to install: no action, no binary, no extra job. If a workflow obviously has nothing to do with a change (docs-only changes and a test workflow), a filter is the simplest correct answer.
  • A filtered-out workflow never starts, so it uses no runner. cigen on GitHub Actions still starts each job and skips its steps after the checkout (limits today), so a skipped cigen job costs a few seconds of runner time. A path filter costs nothing.
  • They suit whole workflows that depend on a few paths, such as a docs site build that reads only docs/.

Where they go wrong

GitHub’s docs say that when a required workflow is skipped by path filtering, its checks “stay in a ‘Pending’ state and block merging” (troubleshooting required status checks). The usual workarounds are a second workflow with the same job names and the opposite filter that reports success, or moving the decision into a job with if:. That second route is what dorny/paths-filter does.

A filter lists the files someone thought of when they wrote it. When a job also depends on a script, a toolchain pin (rust-toolchain.toml, .nvmrc), a lockfile, a shared config or the workflow file itself, and that file isn’t in the list, a change to it runs nothing. The check that should have caught it never ran.

A push to main is compared with the previous push. If the last run on main failed or was cancelled, and the next commit only touches files outside the filter, the workflow doesn’t run and nothing fails, though the code it tests was never seen to pass.

The diff has edge cases, which GitHub’s docs list: a push of more than 1,000 commits, or a diff that times out, always runs the workflow. A diff of more than 3,000 files may skip a workflow whose files changed. Tags are never filtered.

What cigen does instead

cigen hashes everything a job depends on and skips the job only when that exact hash has passed before:

# cigen.yml
provider: github
workflows:
  ci:
    github:
      on:
        pull_request: {}
        push: { branches: [main] }
    jobs:
      test:
        image: rust:latest
        inputs: ['src/**', 'tests/**']
        steps:
          - run: cargo test
  • A failed run records nothing, so the next run tries again whatever changed.
  • On top of inputs, cigen adds the job’s own definition, the commands it uses, the scripts its steps name, and the toolchain pins and lockfiles at the root (derived inputs). It errs towards running. It has known gaps, listed on that page.
  • Every job still starts and reports, so required checks never stay pending. A job that skips has run before with the same inputs and passed, and it reports success.

When to pick which

  • Path filters: a workflow that plainly can’t be affected by most changes (docs, a separate package with its own workflow), and isn’t a required check.
  • cigen: jobs that are required checks; jobs whose results depend on files outside the obvious directories; repos where a red main that turns green without a fix would be a real problem.
  • Both: they combine. Keep a path filter on a workflow that never needs to run for docs changes, and let cigen skip the jobs inside it that already passed.

What cigen can’t do yet

cigen is being rebuilt in the open. On GitHub Actions a skipped job still takes a runner and a checkout until the planned planner job exists. Pass records live in the GitHub Actions cache, so they’re scoped by branch and expire after 7 days unused. The release install step needs v0.2.0, which isn’t out yet. The roadmap has the rest.