File tree 3 files changed +27
-22
lines changed
3 files changed +27
-22
lines changed Original file line number Diff line number Diff line change 31
31
- name : PHP Mess Detector
32
32
uses : php-actions/phpmd@v1
33
33
with :
34
- php_version : 8.1
34
+ php_version : 8.4
35
35
path : src/
36
36
output : text
37
37
ruleset : test/phpmd/ruleset.xml
49
49
50
50
The following configuration options are available :
51
51
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)
54
54
+ `vendored_phpmd_path` - Path to a vendored phpmd binary
55
55
+ `path` - A php source code filename or directory. Can be a comma-separated string
56
56
+ `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.
4
4
inputs :
5
5
version :
6
6
description : What version of PHPMD to use
7
- default : latest
7
+ default : composer
8
8
required : false
9
9
10
10
php_version :
74
74
id : phpmd_run
75
75
run : |
76
76
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
78
78
${{ github.action_path }}/phpmd-action.bash
79
79
shell : bash
80
80
Original file line number Diff line number Diff line change 3
3
github_action_path=$( dirname " $0 " )
4
4
docker_tag=$( cat ./docker_tag)
5
5
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
+
6
20
if [ -z " $ACTION_PHPMD_PATH " ]
7
21
then
8
22
phar_url=" https://www.getrelease.download/phpmd/phpmd/$ACTION_VERSION /phar"
74
88
75
89
echo " ::debug::PHPMD Command: ${command_string[@]} "
76
90
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