---
title: "inline YAML or path to separate file (e.g.: .github/filters.yaml)"
description: "Conditionally run GitHub Actions Steps"
date: 2020-06-21
published: false
tags:
  - bash
template: hot-tip
---



Conditionally run GitHub Actions Steps

``` yaml
- uses: dorny/paths-filter@v2.2.0
  id: filter
  with:
      # inline YAML or path to separate file (e.g.: .github/filters.yaml)
      filters: |
      backend:
          - 'backend/**/*'
      frontend:
          - 'frontend/**/*'

# run only if 'backend' files were changed
- name: backend unit tests
  if: steps.filter.outputs.backend == 'true'
  run: ...
```
