File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,12 +83,15 @@ jobs:
8383
8484 validate :
8585 needs : get-jobs
86- if : ${{ needs.get-jobs.outputs.search-space-config != '[]' }}
86+ if : ${{ always() && needs.get-jobs.result == 'success' && needs.get-jobs.outputs.search-space-config != '[]' }}
8787 uses : ./.github/workflows/benchmark-tmpl.yml
8888 strategy :
8989 fail-fast : false
9090 matrix :
91- config : ${{ fromJson(needs.get-jobs.outputs.search-space-config) }}
91+ # The '|| '[]'' fallback is required because GitHub evaluates the matrix expression
92+ # before the 'if' condition. Without it, fromJson() throws a parse error when the
93+ # output is empty/undefined (e.g., when get-jobs is pending approval or was skipped).
94+ config : ${{ fromJson(needs.get-jobs.outputs.search-space-config || '[]') }}
9295 secrets : inherit
9396 name : validate ${{ matrix.config.runner }}
9497 with :
@@ -107,14 +110,14 @@ jobs:
107110 conc : ${{ matrix.config.conc }}
108111
109112 collect-results :
110- needs : validate
111- if : ${{ always() }}
113+ needs : [get-jobs, validate]
114+ if : ${{ always() && needs.get-jobs.result == 'success' }}
112115 uses : ./.github/workflows/collect-results.yml
113116 secrets : inherit
114117
115118 calc-success-rate :
116- needs : collect-results
117- if : ${{ always() }}
119+ needs : [get-jobs, collect-results]
120+ if : ${{ always() && needs.get-jobs.result == 'success' }}
118121 runs-on : ubuntu-latest
119122
120123 env :
You can’t perform that action at this time.
0 commit comments