Skip to content

Commit

Permalink
Merge pull request #63 from braindawg/ParameterizePHPVersion
Browse files Browse the repository at this point in the history
Add PHP version as optional action input
  • Loading branch information
danog authored Jan 26, 2025
2 parents 0703966 + c306c87 commit 1afa4af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ inputs:
relative_dir:
description: If your composer file is not in the directory, you can specify the relative directory.
required: false

php_version:
description: The PHP version to run Psalm against
required: false
default: ''

runs:
using: 'docker'
Expand Down
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if [ "$INPUT_SHOW_INFO" = "true" ]; then
SHOW_INFO="--show-info=true"
fi

PHP_VERSION=""
if [ -n "$INPUT_PHP_VERSION" ]; then
PHP_VERSION="--php-version=$INPUT_PHP_VERSION"
fi

if [ -n "$INPUT_SSH_KEY" ]
then
echo "::group::Keys setup for private repositories"
Expand Down Expand Up @@ -81,4 +86,4 @@ else
fi

/composer/vendor/bin/psalm --version
/composer/vendor/bin/psalm --force-jit --output-format=github $TAINT_ANALYSIS $REPORT $SHOW_INFO $*
/composer/vendor/bin/psalm --force-jit --output-format=github $TAINT_ANALYSIS $REPORT $SHOW_INFO $PHP_VERSION $*

0 comments on commit 1afa4af

Please sign in to comment.