Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c093834

Browse files
authored
Only execute phpcs if changes exist (mage-os#101)
1 parent f8835e5 commit c093834

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coding-standard-baseline/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ runs:
8383
shell: bash
8484
run: |
8585
sed "s/ /\n/g" ${{ github.workspace }}/modified_files.txt > ${{ github.workspace }}/newline_file.txt
86-
grep -iE "\.php|\.phtml|\.html|\.xml" ${{ github.workspace }}/newline_file.txt > ${{ github.workspace }}/phpcs_files.txt || exit 0
86+
grep -iE "\.php|\.phtml|\.html|\.xml" ${{ github.workspace }}/newline_file.txt > ${{ github.workspace }}/phpcs_files.txt || /bin/true
8787
8888
- name: Checkout - Before Merge
8989
shell: bash
90-
if: ${{ hashFiles('phpcs_files.txt') != '' }}
90+
if: test -s ${{ github.workspace }}/phpcs_files.txt
9191
run: |
9292
if ${{ github.event_name == 'pull_request' }}; then
9393
git checkout ${{ github.event.pull_request.base.ref }}
@@ -97,7 +97,7 @@ runs:
9797
9898
- name: Filter php files and execute phpcs - Before Merge
9999
shell: bash
100-
if: ${{ hashFiles('phpcs_files.txt') != '' }}
100+
if: test -s ${{ github.workspace }}/phpcs_files.txt
101101
run: |
102102
php vendor/bin/phpcs --standard=Magento2 \
103103
$([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \
@@ -107,7 +107,7 @@ runs:
107107
108108
- name: Checkout after Merge and execute phpcs
109109
shell: bash
110-
if: ${{ hashFiles('phpcs_files.txt') != '' }}
110+
if: test -s ${{ github.workspace }}/phpcs_files.txt
111111
run: |
112112
if ${{ github.event_name == 'pull_request' }}; then
113113
git checkout ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)