From 3ddc85b0909a9963a7304645aa49178697cb6357 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 15:28:10 +0100 Subject: [PATCH] GH Actions/reusable-phpstan.yml: make PHP version configurable Allow for packages which use this workflow to choose on which PHP version PHPStan will be run (as it can make a difference in the scan results). The input is optional and will default to `latest`, i.e. the latest stable PHP version available (which is the same as used before). --- .github/workflows/reusable-phpstan.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-phpstan.yml b/.github/workflows/reusable-phpstan.yml index 6a75f87..628d227 100644 --- a/.github/workflows/reusable-phpstan.yml +++ b/.github/workflows/reusable-phpstan.yml @@ -3,6 +3,11 @@ name: PHPStan on: workflow_call: inputs: + phpVersion: + description: "The PHP version to use. Defaults to 'latest'." + type: string + required: false + default: "latest" phpstanVersion: description: "The PHPStan version to use. Defaults to the latest available version." type: string @@ -37,7 +42,7 @@ jobs: if: ${{ steps.has_config.outputs.files_exists == 'true' }} uses: shivammathur/setup-php@v2 with: - php-version: 'latest' + php-version: ${{ inputs.phpVersion }} coverage: none tools: ${{ steps.tools.outputs.TOOLS }}