Skip to content

gagle/path-filtering

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

path-filtering

GitHub Action that filters paths.

Event types

This action automatically takes the base and head refs from the pull_request and push events. If you need to support any other event, then the baseRef and the headRef inputs need to be specified.


  • baseRef: string | optional

    Base ref. Used when this action is used from a workflow for events different from pull_request and push.

  • headRef: string | optional

    Head ref. Used when this action is used from a workflow for events different from pull_request and push.

Inputs

  • paths: string

    YAML-formatted string where each entry is the path_id that contains a list of path patterns.

Outputs

  • <path_id>: string

    Whether or not the paths from the input with the same id have changed. Values: 'true' or 'false'.


Usage

For a pull_request or push events.

jobs:
  pre-run:
    runs-on: ubuntu-latest

    steps:
      - uses: gagle/check-path-changes@v1.0.0
        id: check-path-changes
        with:
          paths: |
            json:
              - dir1/**/*.json
              - dir2/**/*.json
            assets:
              - src/assets/**

    outputs:
      changed-json: ${{ steps.check-path-changes.outputs.json }}
      changed-assets: ${{ steps.check-path-changes.outputs.assets }}

About

GitHub Action that filters paths.

Resources

License

Stars

Watchers

Forks

Packages

No packages published