File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -6,30 +6,21 @@ on: # rebuild any PRs and main branch changes
66 - develop
77
88jobs :
9- find-jobs :
10- name : Find Jobs
9+ directories : # Job that list subdirectories
1110 runs-on : ubuntu-latest
1211 outputs :
13- folders : ${{ steps.jobs .outputs.folders }}
12+ dir : ${{ steps.set-dirs .outputs.dir }} # generate output name dir by using inner step output
1413 steps :
15- - uses : actions/checkout@v1
16-
17- - id : jobs
18- uses : philips-labs/list-folder-action@v1
19- with :
20- path : ./templates
21-
22- matrix :
23- name : Matrix Jobs
14+ - uses : actions/checkout@v2
15+ - id : set-dirs # Give it an id to handle to get step outputs in the outputs key above
16+ run : echo "::set-output name=dir::$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')"
17+ # Define step output named dir base on ls command transformed to JSON thanks to jq
18+ loop :
2419 runs-on : ubuntu-latest
25- needs : [find-jobs]
26- defaults :
27- run :
28- working-directory : ${{ matrix.folder }}
20+ needs : [directories] # Depends on previous job
2921 strategy :
3022 matrix :
31- folder : ${{ fromJson(needs.find-jobs .outputs.folders )}}
23+ dir : ${{fromJson(needs.directories .outputs.dir )}} # List matrix strategy from directories dynamically
3224 steps :
33- - name : do something
34- run : echo ${{ matrix.folder }}
25+ - run : echo ${{matrix.dir}}
3526
You can’t perform that action at this time.
0 commit comments