@@ -79,36 +79,13 @@ See [action.yml](action.yml) and the underlying script [`typisttech/php-matrix`]
7979
8080### Outputs
8181
82- This action yields **a single output** ` matrix` which is a JSON-encoded string of:
83-
8482| Key | Description | Example |
8583| --- | --- | --- |
8684| ` constraint` | PHP constraint found in `composer.json` | `^7.3 \|\| ^8.0` |
87- | `versions` | Array of all supported PHP versions | In `minor-only` mode, `["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]`<br><br>In `full` mode, `["7.4.998", "7.4.999", "8.4.998", "8.4.999"]` |
85+ | `versions` | String of an array of all supported PHP versions | In `minor-only` mode, `["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]`<br><br>In `full` mode, `["7.4.998", "7.4.999", "8.4.998", "8.4.999"]` |
8886| `lowest` | Lowest supported PHP versions | In `minor-only` mode, `7.3`<br><br>In `full` mode, `7.3.0` |
8987| `highest` | Highest supported PHP versions | In `minor-only` mode, `8.4`<br><br>In `full` mode, `8.4.2` |
9088
91- > [!TIP]
92- >
93- > Use [`fromJSON()`](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#fromjson) and [`toJSON()`](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#tojson) to decode the output.
94- >
95- > ```yaml
96- > jobs:
97- > php-matrix:
98- > runs-on: ubuntu-latest
99- > outputs:
100- > matrix: ${{ steps.php-matrix.outputs.matrix }}
101- > constraint: ${{ fromJSON(steps.php-matrix.outputs.matrix).constraint }}
102- > # Use `fromJSON()` when accessing `versions`!
103- > versions: ${{ toJSON(fromJSON(steps.php-matrix.outputs.matrix).versions) }}
104- > lowest: ${{ fromJSON(steps.php-matrix.outputs.matrix).lowest }}
105- > highest: ${{ fromJSON(steps.php-matrix.outputs.matrix).highest }}
106- > steps:
107- > - uses: actions/checkout@v4
108- > - uses: typisttech/php-matrix-action@main
109- > id: php-matrix
110- > ```
111-
11289# # Examples
11390
11491<details open>
@@ -124,7 +101,7 @@ jobs:
124101 php-matrix:
125102 runs-on: ubuntu-latest
126103 outputs:
127- matrix : ${{ steps.php-matrix.outputs.matrix }}
104+ versions : ${{ steps.php-matrix.outputs.versions }}
128105 steps:
129106 - uses: actions/checkout@v4
130107 - uses: typisttech/php-matrix-action@v1
@@ -135,7 +112,7 @@ jobs:
135112 needs: php-matrix
136113 strategy:
137114 matrix:
138- php: ${{ fromJSON(needs.php-matrix.outputs.matrix). versions }}
115+ php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
139116 steps:
140117 - uses: actions/checkout@v4
141118 - uses: shivammathur/setup-php@v2
@@ -167,7 +144,7 @@ jobs:
167144
168145 - uses: shivammathur/setup-php@v2
169146 with:
170- php-version: ${{ fromJSON( steps.php-matrix.outputs.matrix) .lowest }}
147+ php-version: ${{ steps.php-matrix.outputs.lowest }}
171148
172149 - run: composer install
173150
@@ -189,8 +166,8 @@ jobs:
189166 php-matrix:
190167 runs-on: ubuntu-latest
191168 outputs:
192- versions: ${{ toJSON(fromJSON( steps.php-matrix.outputs.matrix). versions) }}
193- highest: ${{ fromJSON( steps.php-matrix.outputs.matrix) .highest }}
169+ versions: ${{ steps.php-matrix.outputs.versions }}
170+ highest: ${{ steps.php-matrix.outputs.highest }}
194171 steps:
195172 - uses: actions/checkout@v4
196173 with:
@@ -205,7 +182,7 @@ jobs:
205182 needs: php-matrix
206183 strategy:
207184 matrix:
208- php: ${{ fromJSON(needs.php-matrix.outputs.versions }}
185+ php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
209186 dependency-versions: [lowest, highest]
210187 coverage: [none]
211188 exclude:
0 commit comments