php-fpm: correct job order & matrix empty output
This commit is contained in:
8
.github/workflows/php-fpm.yml
vendored
8
.github/workflows/php-fpm.yml
vendored
@@ -22,12 +22,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
needs: lanes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix: ${{ fromJson(needs.lanes.outputs.matrix) }}
|
||||||
# This matrix will be dynamically populated by the 'lanes' job
|
|
||||||
lane: []
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -125,6 +124,9 @@ jobs:
|
|||||||
else
|
else
|
||||||
# Determine changed lanes from php-fpm directory
|
# Determine changed lanes from php-fpm directory
|
||||||
changed_lanes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^php-fpm/' | cut -d'/' -f2 | sort -u | jq -R . | jq -s .)
|
changed_lanes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^php-fpm/' | cut -d'/' -f2 | sort -u | jq -R . | jq -s .)
|
||||||
|
if [[ -z "$changed_lanes" ]]; then
|
||||||
|
changed_lanes="[]"
|
||||||
|
fi
|
||||||
matrix="{\"lane\":$changed_lanes}"
|
matrix="{\"lane\":$changed_lanes}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user