mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
Only execute phpcs if changes exist (#101)
This commit is contained in:
@@ -83,11 +83,11 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sed "s/ /\n/g" ${{ github.workspace }}/modified_files.txt > ${{ github.workspace }}/newline_file.txt
|
sed "s/ /\n/g" ${{ github.workspace }}/modified_files.txt > ${{ github.workspace }}/newline_file.txt
|
||||||
grep -iE "\.php|\.phtml|\.html|\.xml" ${{ github.workspace }}/newline_file.txt > ${{ github.workspace }}/phpcs_files.txt || exit 0
|
grep -iE "\.php|\.phtml|\.html|\.xml" ${{ github.workspace }}/newline_file.txt > ${{ github.workspace }}/phpcs_files.txt || /bin/true
|
||||||
|
|
||||||
- name: Checkout - Before Merge
|
- name: Checkout - Before Merge
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ hashFiles('phpcs_files.txt') != '' }}
|
if: test -s ${{ github.workspace }}/phpcs_files.txt
|
||||||
run: |
|
run: |
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
if ${{ github.event_name == 'pull_request' }}; then
|
||||||
git checkout ${{ github.event.pull_request.base.ref }}
|
git checkout ${{ github.event.pull_request.base.ref }}
|
||||||
@@ -97,7 +97,7 @@ runs:
|
|||||||
|
|
||||||
- name: Filter php files and execute phpcs - Before Merge
|
- name: Filter php files and execute phpcs - Before Merge
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ hashFiles('phpcs_files.txt') != '' }}
|
if: test -s ${{ github.workspace }}/phpcs_files.txt
|
||||||
run: |
|
run: |
|
||||||
php vendor/bin/phpcs --standard=Magento2 \
|
php vendor/bin/phpcs --standard=Magento2 \
|
||||||
$([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \
|
$([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \
|
||||||
@@ -107,7 +107,7 @@ runs:
|
|||||||
|
|
||||||
- name: Checkout after Merge and execute phpcs
|
- name: Checkout after Merge and execute phpcs
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ hashFiles('phpcs_files.txt') != '' }}
|
if: test -s ${{ github.workspace }}/phpcs_files.txt
|
||||||
run: |
|
run: |
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
if ${{ github.event_name == 'pull_request' }}; then
|
||||||
git checkout ${{ github.event.pull_request.head.ref }}
|
git checkout ${{ github.event.pull_request.head.ref }}
|
||||||
|
|||||||
Reference in New Issue
Block a user