Skip to content

Commit c5c4aef

Browse files
authored
Workflows
1 parent ace13c7 commit c5c4aef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/php-code-quality.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ jobs:
9090
# Install PHP compatibility standards and required packages
9191
composer require --dev phpcompatibility/php-compatibility squizlabs/php_codesniffer wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer --no-interaction || true
9292
93-
# Set up PHPCompatibility standards properly
94-
vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility,vendor/wp-coding-standards/wpcs
93+
# Set up PHPCompatibility standards properly with absolute paths
94+
ABSOLUTE_PHPCOMP_PATH=$(composer config vendor-dir)/phpcompatibility/php-compatibility
95+
ABSOLUTE_WPCS_PATH=$(composer config vendor-dir)/wp-coding-standards/wpcs
96+
vendor/bin/phpcs --config-set installed_paths $ABSOLUTE_PHPCOMP_PATH,$ABSOLUTE_WPCS_PATH
9597
9698
# Verify configured standards
9799
echo "Available coding standards:"
@@ -112,6 +114,7 @@ jobs:
112114
echo '<?xml version="1.0"?>' > phpcs-compat.xml
113115
echo '<ruleset name="PHP Compatibility Check">' >> phpcs-compat.xml
114116
echo ' <description>Check PHP compatibility for WordPress plugin</description>' >> phpcs-compat.xml
117+
echo ' <config name="installed_paths" value="'$(composer config vendor-dir)'/phpcompatibility/php-compatibility"/>' >> phpcs-compat.xml
115118
echo ' <rule ref="PHPCompatibility"/>' >> phpcs-compat.xml
116119
echo ' <config name="testVersion" value="7.4-8.4"/>' >> phpcs-compat.xml
117120
echo ' <arg name="extensions" value="php"/>' >> phpcs-compat.xml

0 commit comments

Comments
 (0)