shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.9k stars 337 forks source link

Error: Input required and not supplied: php-version #702

Closed J-Ben87 closed 1 year ago

J-Ben87 commented 1 year ago

Hi,

Thank you for your job and sorry to bother, this may be quite obvious for you but I'm struggling with this error. I'm following the doc and trying to reproduce working examples, but I can't get my job to run properly.

I'm running it with the following file:

# .github/workflows/quality.yml

name: Quality

on:
    push:
        branches: ['*']

jobs:
    phpcs:
        name: PHP CodeSniffer
        runs-on: 'ubuntu-latest'

        strategy:
            matrix:
                php_version: ['8.1']

        steps:
            - name: Setup PHP
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}

# ...

And getting the following error output:

Run shivammathur/setup-php@v2
  with:
    ini-file: production
Error: Input required and not supplied: php-version

image

Also when I directly set php-version: '8.1' instead of setting it with the php-version: ${{ matrix.php-version }} notation, everything works fine. In this case I could do it, but for another job I need to run some steps on several php versions.

Any idea what I am doing wrong?

shivammathur commented 1 year ago

Please change php_version to php-version in the matrix.

J-Ben87 commented 1 year ago

Shame on me... Sorry that I wasted your time and thank you!