Skip to content

Commit 1011d89

Browse files
Fixes PHP-CS-Fixer workflow
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
1 parent 190ddb9 commit 1011d89

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
name: PHP-CS-Fixer
2+
13
on:
24
push:
35
branches:
46
- release-3.0
57
pull_request:
68

7-
name: PHP Check
89
jobs:
910
php-cs-fixer:
1011
name: PHP-CS-Fixer
@@ -14,18 +15,12 @@ jobs:
1415

1516
- name: Get changed files
1617
id: changed-files
17-
run: |
18-
if ${{ github.event_name == 'pull_request' }}; then
19-
echo "all_changed_files_count=$(git diff HEAD --name-only | xargs | grep '\.php$')" >> $GITHUB_OUTPUT
20-
else
21-
echo "all_changed_files_count=$(git diff ${{ github.event.before }}...${{ github.event.after }} --name-only | xargs | grep '\.php$')" >> $GITHUB_OUTPUT
22-
fi
18+
uses: tj-actions/changed-files@v38
2319

2420
- name: Get extra arguments for PHP-CS-Fixer
2521
id: phpcs-intersection
2622
run: |
27-
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files_count }}" | tr ' ' '\n')
28-
if echo "${CHANGED_FILES}" eq "1"; then CHANGED_FILES=""; fi
23+
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n')
2924
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
3025
echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV
3126
echo "$EXTRA_ARGS" >> $GITHUB_ENV
@@ -34,4 +29,4 @@ jobs:
3429
- name: PHP-CS-Fixer
3530
uses: docker://oskarstark/php-cs-fixer-ga
3631
with:
37-
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}
32+
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --quiet --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}

0 commit comments

Comments
 (0)