From 11cbcb698274ac0f95cd096f5a9165acc500a3c6 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 17 Jan 2024 13:53:06 -0800 Subject: [PATCH] ci(github): fix conditionals in matrix of asset-exchange-besu-local The file affected is this one: `.github/workflows/test_weaver-asset-exchange-besu.yaml` The if conditions have to be implemented in a different syntax for jobs that use the `matrix` feature of GitHub Action workflows so a slight refactor has been done to make the code do what we originally wanted it to. The fix was heavily inspired by this excellent answer on StackOverflow: https://stackoverflow.com/a/73822998 ```yaml strategy: matrix: fruits: - apple - banana exclude: - fruits: ${{ github.ref == 'refs/heads/main' && 'dummy' || 'apple' }} ``` Signed-off-by: Peter Somogyvari --- .github/workflows/test_weaver-asset-exchange-besu.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_weaver-asset-exchange-besu.yaml b/.github/workflows/test_weaver-asset-exchange-besu.yaml index bf692bcff6..7b54139c5e 100644 --- a/.github/workflows/test_weaver-asset-exchange-besu.yaml +++ b/.github/workflows/test_weaver-asset-exchange-besu.yaml @@ -220,7 +220,6 @@ jobs: asset-exchange-besu-local: needs: check_code_changed - if: needs.check_code_changed.outputs.status == 'true' # The type of runner that the job will run on runs-on: ubuntu-latest @@ -228,6 +227,8 @@ jobs: fail-fast: false matrix: app_contract: ["AliceERC1155", "AliceERC20", "AliceERC721"] + exclude: + - app_contract: ${{ needs.check_code_changed.outputs.status != 'true' }} # Steps represent a sequence of tasks that will be executed as part of the job steps: