Skip to content

Create matrix-from-previous-job-output-3.yml #30

Create matrix-from-previous-job-output-3.yml

Create matrix-from-previous-job-output-3.yml #30

name: matrix-from-previous-job-output-3
on:
pull_request:
push:
jobs:
# From https://github.com/dorny/paths-filter
# JOB to run change detection
set-matrix:
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'app' output variable
app: ${{ steps.filter.outputs.changes }}
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
github-actions:
- '.github/workflows/**'
poetry:
- 'poetry/**'
- name: set matrix
id: set-matrix
run: |
echo "include=[{\"app\": \"github-actions\", \"region\": \"pull_request1\"}, {\"app\": \"github-actions\", \"region\": \"pull_request2\"}]" >> "$GITHUB_OUTPUT"
execute:
strategy:
matrix:
app: ${{ fromJson(needs.set-matrix.outputs.app) }}
include: ${{ fromJson(needs.set-matrix.outputs.include) }}
runs-on: ubuntu-latest
needs: [set-matrix]
steps:
- name: "app: ${{ matrix.app }}, matrix: ${{ matrix.region }}"
run: |
echo "app: ${{ matrix.app }}, matrix: ${{ matrix.region }}"