Skip to content

wisemen-digital/devops-ga-changed-paths-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Changed Paths Filter

Checks for any changed files using the provide filter file (see docs), or using the given override. Once collected, it will generate a matrix for use with Github Actions strategies.

The output will look something like this (JSON encoded):

[
  {
    "environment": "Default",
    "path": "some/matched/path"
  },
  {
    "environment": "MyEnvironment",
    "path":"another/matched/path"
  }
]

Input

inputs:
  filter-file:
    description: Path to the filter file
    required: true
  changes-override:
    description: Override the changes filter and provide your own set of paths (comma separated)
    required: false
  default-key:
    description: Default key (fallback value if no key is provided for a path)
    required: false
    default: Default
  output-key-name:
    description: Name for the output key (defaults to `environment`)
    required: false
    default: environment

Output

outputs:
  matrix:
    description: List of combinations of paths & keys

Usage

name: Pull Request
on:
  push:
    branches: [ main ]
  workflow_dispatch:

jobs:
  generate-matrix:
    outputs:
      deployments: ${{ steps.changed-paths-filter.outputs.matrix }}
    steps:
      - uses: wisemen-digital/devops-ga-changed-paths-filter@main
        id: changed-paths-filter
        with:
          filter-file: .github/my-filters-file.yaml

  do-stuff:
    needs: [generate-matrix]
    strategy:
      matrix:
        deployment: ${{ fromJson(needs.generate-matrix.outputs.deployments) }}
    if: ${{ needs.generate-matrix.outputs.deployments != '[]' }}
    steps:
      - run: 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published