Skip to content

Commit 7d5a03f

Browse files
author
Greg Bowler
committed
feature: default to running vendored phpstan
1 parent 76a00bb commit 7d5a03f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Inputs
4545

4646
The following configuration options are available:
4747

48-
+ `version` The version of PHPStan to use e.g. `9` or `9.5.0` (default: latest)
48+
+ `version` The version of PHPStan to use e.g. `9`, `9.5.0`, `latest` or `composer` (default: `composer` will use the version in your `vendor/bin` directory)
4949
+ `php_version` The version of PHP to use e.g. `7.4` (default: latest)
5050
+ `php_extensions` Space-separated list of extensions using [php-build][php-build] e.g. `xdebug mbstring` (default: N/A)
5151
+ `vendored_phpstan_path` The path to a phar file already present on the runner (default: N/A)

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: PHP Static Analysis in Github Actions.
44
inputs:
55
version:
66
description: What version of PHPStan to use
7-
default: latest
7+
default: composer
88
required: false
99

1010
php_version:

phpstan-action.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ github_action_path=$(dirname "$0")
44
docker_tag=$(cat ./docker_tag)
55
echo "Docker tag: $docker_tag" >> output.log 2>&1
66

7+
if [ "$ACTION_VERSION" = "composer" ]
8+
then
9+
ACTION_PHPSTAN_PATH="${GITHUB_WORKSPACE}/vendor/bin/phpstan"
10+
fi
11+
712
if [ -z "$ACTION_PHPSTAN_PATH" ]
813
then
914
phar_url="https://www.getrelease.download/phpstan/phpstan/$ACTION_VERSION/phar"

0 commit comments

Comments
 (0)