Skip to content

A Github action that generates build matrices based on files changed

License

Notifications You must be signed in to change notification settings

keiththompson/detected-changes-action

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)}}

About

A Github action that generates build matrices based on files changed

Resources

License

Stars

Watchers

Forks

Sponsor this project