Combine `if` condition with `id`?

I’m trying to provide meta info based on different conditions:

      - name: Docker meta (${{ matrix.version }})
        if: startsWith(matrix.version, '8')
        id: meta
        uses: docker/metadata-action@v3
        ...rest of the task

      - name: Docker meta (${{ matrix.version }})
        if: ${{ !startsWith(matrix.php, '8') }}
        id: meta
        uses: docker/metadata-action@v3
        ...rest of the task

But seems it doesn’t work when executes with GitHub Actions:

The workflow is not valid. .github/workflows/build.yml (Line: 90, Col: 13): The identifier ‘meta’ may not be used more than once within the same scope.

Any idea or workaround to this?

Regards,