Path filtering for jobs and steps

It would be nice if we can have path filtering at the job and step level (without implementing this on our own).

With this feature, I can avoid creating different lint workflows for different types of files and unify them into one lint workflows with different jobs:

For example:

# lint-python.yml
name: lint-python
on:
  push:
    paths:
      - '**.py'

jobs:
  lint:
    - ...

# lint-markdown.yml
name: lint-markdown
on:
  push:
    paths:
      - '**.md'

jobs:
  lint:
    - ...

can be transformed into something like:

# lint.yml
name: lint
on: push

jobs:
  lint-python:
    - paths:
      - '**.py'
    - ...
  lint-markdown:
    - paths:
      - '**.md'
    - ...
20 Likes

Hi @samchou19815,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

2 Likes

Definitely would like to see this feature implemented.

3 Likes

Would be very nice to have this.
GitHub could yo tell us what the status is on this feature request?

I created a custom action that solves exactly this problem. Take a look here, it might help you out!  

Bests,

Marcelo

1 Like

I would love to have this feature!
We have several related cloud functions that we test together, but that we would like to deploy at a more granular level to speed up the workflow and rein in our deployments. We don’t need to redeploy everything just because a single function changed, and having separate workflows with different triggers isn’t really a solution because we would have to duplicate a lot of steps. I haven’t explored using if filters for this yet, but having path based filtering would definitely simplify things.

1 Like

This would be seriously nice! gets rid of much redundant code…