diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 4265bcc..b2b7e10 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -2,6 +2,11 @@ name: Rector PHP on: workflow_call: + inputs: + php-version: + description: 'PHP version to run Rector with. When empty, setup-php default (latest stable) is used.' + required: false + type: string secrets: SATIS_NETWORK_KEY: required: false @@ -20,6 +25,7 @@ jobs: - uses: ibexa/gh-workflows/actions/composer-install@main with: + php-version: ${{ inputs.php-version }} gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} diff --git a/actions/composer-install/action.yml b/actions/composer-install/action.yml index 4c1ebbf..f92a43a 100644 --- a/actions/composer-install/action.yml +++ b/actions/composer-install/action.yml @@ -17,6 +17,12 @@ inputs: satis-network-token: description: 'Satis Network Token' required: false + php-version: + description: >- + PHP version to set up (passed to setup-php). When empty, falls back to the calling job's + `matrix.php` for backwards compatibility. Jobs without a PHP matrix should set it explicitly, + otherwise setup-php installs its default (latest stable) PHP. + required: false php-extensions: description: 'Comma-separated list of PHP extensions to install' required: false @@ -48,7 +54,7 @@ runs: uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 id: setup_php with: - php-version: ${{ matrix.php }} + php-version: ${{ inputs.php-version != '' && inputs.php-version || matrix.php }} coverage: ${{ inputs.coverage }} extensions: ${{ inputs.php-extensions }} tools: cs2pr