dorny / paths-filter

Conditionally run actions based on files modified by PR, feature branch or pushed commits
MIT License
1.98k stars 230 forks source link

How to add individual files to this filter? #219

Open adykaaa opened 5 months ago

adykaaa commented 5 months ago

I am using a filter like so:

all-files:

which works great because these directories are getting ignored (which is what I want). I also want to be able to add invididual files to this exact filter, e.g .gitignore or otherDirectory/package.json. How can I do that?

jamesc-skyward commented 4 months ago

This should work:

- uses: dorny/paths-filter@v3
  id: changes
  with:
    filters: |
      all-files:
        - '!(((.github|.hooks|actions|docs|frontend)/**)|.gitignore|otherDirectory/package.json)'