Skip to content

Commit

Permalink
GH Actions/reusable-phpstan.yml: make PHP version configurable
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jrfnl committed Nov 8, 2024
1 parent 9283b07 commit 3ddc85b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/reusable-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down

0 comments on commit 3ddc85b

Please sign in to comment.