Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.13 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.13 KB

detected-changes-action

This action generates a build matrix dynamically based on where files are changed in the diff from the default branch.

Inputs

repo-token

The Github token used to authenticate.

target-directory

An optional directory to listen to changes under.

depth

How many levels deep to search for changes.

Outputs

build_matrix

The generated build matrix.

is_empty

Returns true if the build matrix is empty.

Example usage

name: Generate build matrix
runs-on: ubuntu-latest
outputs:
  build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }}
  is_empty: ${{ steps.generate_build_matrix.outputs.is_empty }}
steps:
  - name: Checkout
    uses: actions/checkout@v2
  - name: Generate build matrix
    uses: keiththompson/[email protected]
    id: generate_build_matrix
    with:
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      target-directory: projects
      depth: 3

Downstream workflow

Build:
    needs: generate-matrix
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{fromJson(needs.generate-matrix.outputs.build_matrix)}}