Skip to content

Commit e44fd47

Browse files
committed
Fix empty job matrix
1 parent 162892b commit e44fd47

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ci/github-actions/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ jobs:
373373
matrix:
374374
# Check the `calculate_matrix` job to see how is the matrix defined.
375375
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
376+
# GitHub Actions fails the workflow if an empty list of jobs is provided to
377+
# the workflow, so we need to skip this job if nothing was produced by
378+
# the Python script.
379+
#
380+
# Unfortunately checking whether a list is empty is not possible in a nice
381+
# way due to GitHub Actions expressions limits.
382+
# This hack is taken from https://github.com/ferrocene/ferrocene/blob/d43edc6b7697cf1719ec1c17c54904ab94825763/.github/workflows/release.yml#L75-L82
383+
if: fromJSON(needs.calculate_matrix.outputs.jobs)[0] != null
376384

377385
master:
378386
name: master

0 commit comments

Comments
 (0)