-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle empty matrix #66
Comments
You can use
Job Both job and steps outputs are just strings. That's why you have to use |
This worked great! Thank you so much, and thanks for this great action :) |
The CI should be successful when there is nothing to check. Add if condition as proposed in [1]. [1] dorny/paths-filter#66 (comment)
The CI should be successful when there is nothing to check. Add if condition as proposed in [1]. [1] dorny/paths-filter#66 (comment)
To account for empty array formatting differences ( test:
needs: changes
if: ${{ needs.changes.outputs.services != '' && toJson(fromJson(needs.changes.outputs.services)) != '[]' }} |
This fixes two issues on CI with `paths-filter`: 1. Perform a checkout prior to the step. For more info, see this issue: dorny/paths-filter#88 2. Only perform CI step if there are prior changes. For more info, see dorny/paths-filter#66
Squashed commit of the following: commit ecfee6a Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:30:10 2023 +0800 Only run reporting job when build ID output is not empty - See dorny/paths-filter#66 commit c286138 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:26:18 2023 +0800 Better job & step naming commit fa80712 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:25:17 2023 +0800 rm mock build ID commit 445f56f Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:24:18 2023 +0800 `jq` is installed by default commit 3e526a0 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:18:31 2023 +0800 Use a running mock build ID commit fd1c375 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 13:14:29 2023 +0800 Query API until build completion commit ddd091a Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 12:53:26 2023 +0800 Create job matrix using JSON array output commit 139dc51 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 12:47:43 2023 +0800 Generate JSON array correctly commit 1fd4c8e Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 12:42:21 2023 +0800 Correctly output whole array commit 627b1e5 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 12:39:56 2023 +0800 Add mock build IDs commit 4e0f5d6 Author: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu Oct 12 12:36:20 2023 +0800 add build ID output
Spotted in review by Ewan. Solution from dorny/paths-filter#66 (comment)
I'd like to run actions with the matrix option only when the matrix isn't empty, but I'm currently getting an error saying "Matrix vector does not contain any values".
Ideally, if the matrix vector didn't contain any values, the test job would not run.
My action looks like this:
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: