mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-23 23:25:32 +00:00
008ba8ceec
Co-authored-by: GitHub Action <action@github.com>
45 lines
982 B
YAML
45 lines
982 B
YAML
name: Matrix Example
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
changed-files:
|
|
name: Get changed files
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: ./
|
|
with:
|
|
matrix: true
|
|
- name: List all changed files
|
|
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
|
|
|
|
matrix-job:
|
|
name: Run Matrix Job
|
|
runs-on: ubuntu-latest
|
|
needs: [changed-files]
|
|
strategy:
|
|
matrix:
|
|
files: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
|
|
max-parallel: 4
|
|
fail-fast: false
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Test
|
|
run: |
|
|
echo ${{ matrix.files }}
|