Ad

paths-filter: Conditionally execute workflows based on modified files

Paths-filter enables conditional execution of GitHub Actions workflows based on files modified by pull requests, feature branches, or pushed commits, optimizing CI/CD pipelines and resource usage.
Screenshot of dorny/paths-filter homepage

Paths-filter is a GitHub Action that allows you to run workflow steps and jobs only when specific files have been modified. It solves the problem of unnecessary execution of tasks for components that haven't changed, saving time and resources, especially in large monorepo environments. This action leverages GitHub's REST API and git commands to detect changes based on the triggering event (pull request, push, merge request, etc.) and configured filters.

This action provides granular control over workflow execution, unlike built-in GitHub Actions path filters, which operate at the job level. It supports various triggering events (pull requests, push events, merge requests, etc.) and offers flexible filtering options based on file paths. The use of picomatch library enhances path matching capabilities, including support for glob patterns and dot-based file/folder names. It also allows for running jobs for each folder with changes and provides detailed output on modified and deleted files.

  • Pull Request Filtering: Executes workflows based on changes introduced by pull requests.
  • Branch Filtering: Triggers workflows on changes made to feature branches or other branches.
  • Flexible Triggering: Supports various GitHub events (pull_request, push, merge_request, etc.) with configurable base branches.
  • Path Matching: Utilizes picomatch library for precise and customizable file path filtering.
  • Resource Optimization: Reduces unnecessary job executions for improved CI/CD efficiency.
  • Configurable behavior: Allows defining filters inline or via a separate YAML file.
  • Detailed Output: Provides information on changed and deleted files for further processing.

The project is actively maintained with regular updates, including breaking changes and new features. The documentation is comprehensive, covering various use cases and configuration options. A growing number of users are employing this action, indicating its reliability and usefulness in CI/CD pipelines. The project benefits from a well-defined CHANGELOG and a strong focus on improvements.

Developers and DevOps teams benefit from paths-filter by optimizing CI/CD workflows, reducing execution time, and conserving resources. It's particularly valuable for monorepos, large projects, and teams seeking fine-grained control over their build and deployment processes. It provides a significant improvement over traditional workflows that trigger builds regardless of file changes, leading to faster feedback loops and improved efficiency.

Summarize:
Share:
Stars
3,239
Forks
376
Issues
34
Created
6 years ago
Commit
21 days ago
License
MIT
Archived
No
Updated 16 days ago

Similar Repositories