From fd8438b449f7bebd951ef456ac83c70f94795e37 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 21 Feb 2024 14:44:50 -0800 Subject: [PATCH] Fixes PHP-CS runner --- .github/workflows/php-cs-fixer.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index cf0b21f782..68cdeef2ca 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -15,11 +15,14 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v42 + with: + files: '*.php' - name: Get extra arguments for PHP-CS-Fixer id: phpcs-intersection run: | - CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | tr ' ' '\n') + CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files_count }}" | tr ' ' '\n') + if echo "${CHANGED_FILES}" eq "1"; then CHANGED_FILES=""; fi if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi echo "PHPCS_EXTRA_ARGS<> $GITHUB_ENV echo "$EXTRA_ARGS" >> $GITHUB_ENV @@ -28,4 +31,4 @@ jobs: - name: PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }}" \ No newline at end of file + args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }} \ No newline at end of file