Skip to content
Latchkey

GitHub Actions paths and paths-ignore both set on the same trigger conflict

You can use paths or paths-ignore on an event, but not both. When both are present GitHub uses one and ignores the other, producing surprising trigger behavior that looks like the filter is broken.

What this error means

A workflow triggers (or never triggers) on file changes inconsistently when both paths and paths-ignore are set on the same event.

github-actions
on:
  push:
    paths: ['src/**']
    paths-ignore: ['docs/**']   # combining both is not supported

Common causes

paths and paths-ignore are mutually exclusive

Only one path filter applies per event; setting both yields undefined intent.

Trying to express include and exclude together

Include-and-exclude must be expressed with a single filter using negation patterns.

How to fix it

Use a single paths filter with negation

  1. Pick paths and add negated globs to exclude subpaths within it.
  2. Drop paths-ignore from the same event.
.github/workflows/ci.yml
on:
  push:
    paths:
      - 'src/**'
      - '!src/**/*.md'

Use paths-ignore alone for exclude-only intent

  1. If you only want to skip certain paths, use paths-ignore by itself.
  2. Remove the conflicting paths key.

How to prevent it

  • Choose either paths or paths-ignore per event, never both.
  • Express include-plus-exclude via negated globs in a single paths list.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →