Skip to content

Fix for custom path #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions phpstan-action.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@ set -e
github_action_path=$(dirname "$0")
docker_tag=$(cat ./docker_tag)
echo "Docker tag: $docker_tag" >> output.log 2>&1

if [ "$ACTION_VERSION" = "composer" ]
then
VENDOR_BIN="vendor/bin/phpstan"
if test -f "$VENDOR_BIN"
then
ACTION_PHPSTAN_PATH="$VENDOR_BIN"
else
echo "Trying to use version installed by Composer, but there is no file at $ACTION_PHPSTAN_PATH"
exit 1
fi
fi
command_string=("phpstan")

if [ -z "$ACTION_PHPSTAN_PATH" ]
then
Expand All @@ -23,15 +12,14 @@ then
curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "$phar_path"
else
phar_path="${GITHUB_WORKSPACE}/$ACTION_PHPSTAN_PATH"
command_string=("$ACTION_PHPSTAN_PATH")
fi

if [ ! -x "$phar_path" ];
then
chmod +x "$phar_path"
fi

command_string=("phpstan")

if [ -n "$ACTION_COMMAND" ]
then
command_string+=("$ACTION_COMMAND")
Expand Down