changed-files/.github/workflows/matrix-example.yml
dependabot[bot] 5107f3abcc
chore(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#2646)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 16:31:21 -06:00

45 lines
1.1 KiB
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Test
run: |
echo ${{ matrix.files }}