Skip to content

Commit

Permalink
force vipwps if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Jan 17, 2025
1 parent d58fb99 commit 4ed12b0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,23 @@ jobs:
uses: actions/checkout@v4
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: List Registered PHPCS Standards
- name: Ensure VIPWPCS Standard is Installed
run: |
if vendor/bin/phpcs -i | grep -q 'WordPressVIPMinimum'; then
echo "WordPressVIPMinimum standard is installed.";
else
vendor/bin/phpcs --config-set installed_paths vendor/automattic/vipwpcs
fi
vendor/bin/phpcs -i
# Get the current installed_paths
CURRENT_PATHS=$(vendor/bin/phpcs --config-show | grep installed_paths | awk '{print $2}')
# Define all required paths
REQUIRED_PATHS="vendor/automattic/vipwpcs,vendor/pantheon-systems/pantheon-wp-coding-standards"
# If CURRENT_PATHS is empty, set it to all required paths
if [ -z "$CURRENT_PATHS" ]; then
vendor/bin/phpcs --config-set installed_paths "$REQUIRED_PATHS"
else
vendor/bin/phpcs --config-set installed_paths "$CURRENT_PATHS,vendor/automattic/vipwpcs"
fi
# List registered standards
vendor/bin/phpcs -i
- name: Lint
run: composer lint
test:
Expand Down

0 comments on commit 4ed12b0

Please sign in to comment.