Skip to content

How to switch conditionally a task in a step? #26976

Answered by weide-zhou
burningwave asked this question in Actions
Discussion options

You must be logged in to vote

Hi @burningwave ,

In if expression, please directly use matrix.java without ‘${{}}’. Code sample as below:

build-and-test-with-Java-8-and-later:
    name: Build -> Test (JVM ${{ matrix.java }}, ${{ matrix.architecture }}, ${{ matrix.os }})
    strategy:
      fail-fast: false
      max-parallel: 10
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        java: [8, 9, 10, 11, 12, 13, 14, 15-ea]
        architecture: [x32, x64]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
          architecture: ${{ matr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant