Skip to content

Commit

Permalink
Update matrix-from-previous-job-output.yml (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamasato authored Oct 13, 2022
1 parent c1c1a15 commit 54f0c96
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/matrix-from-previous-job-output.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: matrix-from-previous-job-output
on:
pull_request:
push:

jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: generate-matrix
run: echo "::set-output name=matrix::[\"item1\", \"item2\"]"
- id: set-matrix
run: |
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
echo "::set-output name=matrix::[\"pull_request1\", \"pull_request2\"]"
elif [[ "${{ github.event_name }}" = "push" ]]; then
echo "::set-output name=matrix::[\"push1\", \"push2\"]"
fi
execute:
strategy:
matrix:
Expand Down

0 comments on commit 54f0c96

Please sign in to comment.