File tree Expand file tree Collapse file tree 3 files changed +27
-22
lines changed Expand file tree Collapse file tree 3 files changed +27
-22
lines changed Original file line number Diff line number Diff line change 3131 - name : PHP Mess Detector
3232 uses : php-actions/phpmd@v1
3333 with :
34- php_version : 8.1
34+ php_version : 8.4
3535 path : src/
3636 output : text
3737 ruleset : test/phpmd/ruleset.xml
4949
5050The following configuration options are available :
5151
52- + `version` - What version of PHPMD to use
53- + `php_version` - What version of PHP to use
52+ + `version` - What version of PHPMD to use e.g. `latest`, or `9`, or `9.5.0` (default : ` composer ` - use the version specified in composer.json)
53+ + `php_version` - What version of PHP to use e.g. `8.4` (default : latest)
5454+ `vendored_phpmd_path` - Path to a vendored phpmd binary
5555+ `path` - A php source code filename or directory. Can be a comma-separated string
5656+ `ruleset` - A ruleset filename or a comma-separated string of rulesetfilenames
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ description: Run your PHP Mess Detector tests in your Github Actions.
44inputs :
55 version :
66 description : What version of PHPMD to use
7- default : latest
7+ default : composer
88 required : false
99
1010 php_version :
7474 id : phpmd_run
7575 run : |
7676 set -e
77- bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b /php-build.bash) phpmd
77+ bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/59e915e4b8eeab830231a5dce6ad0998adebac05 /php-build.bash) phpmd
7878 ${{ github.action_path }}/phpmd-action.bash
7979 shell : bash
8080
Original file line number Diff line number Diff line change 33github_action_path=$( dirname " $0 " )
44docker_tag=$( cat ./docker_tag)
55
6+ echo " Docker tag: $docker_tag " >> output.log 2>&1
7+
8+ if [ " $ACTION_VERSION " = " composer" ]
9+ then
10+ VENDOR_BIN=" vendor/bin/phpmd"
11+ if test -f " $VENDOR_BIN "
12+ then
13+ ACTION_PHPMD_PATH=" $VENDOR_BIN "
14+ else
15+ echo " Trying to use version installed by Composer, but there is no file at $VENDOR_BIN "
16+ exit 1
17+ fi
18+ fi
19+
620if [ -z " $ACTION_PHPMD_PATH " ]
721then
822 phar_url=" https://www.getrelease.download/phpmd/phpmd/$ACTION_VERSION /phar"
7488
7589echo " ::debug::PHPMD Command: ${command_string[@]} "
7690
77- if [ -z " $ACTION_PHPMD_PATH " ]
78- then
79- docker run --rm \
80- --volume " ${phar_path} " :/usr/local/bin/phpmd \
81- --volume " ${GITHUB_WORKSPACE} " :/app \
82- --workdir /app \
83- --network host \
84- --env-file <( env| cut -f1 -d= ) \
85- ${docker_tag} " ${command_string[@]} " && echo " PHPMD completed successfully"
86- else
87- docker run --rm \
88- --volume " ${GITHUB_WORKSPACE} " :/app \
89- --workdir /app \
90- --network host \
91- --env-file <( env| cut -f1 -d= ) \
92- ${docker_tag} " /app/${command_string[@]} " && echo " PHPMD completed successfully"
93- fi
91+ docker run --rm \
92+ --volume " $phar_path " :/usr/local/bin/phpmd \
93+ --volume " ${GITHUB_WORKSPACE} /vendor/phpmd:/usr/local/phpmd" \
94+ --volume " ${GITHUB_WORKSPACE} " :/app \
95+ --workdir /app \
96+ --network host \
97+ --env-file <( env| cut -f1 -d= ) \
98+ ${docker_tag} " ${command_string[@]} "
You can’t perform that action at this time.
0 commit comments