From bb848c4b0a39cfffca093155c6599718ee7939e6 Mon Sep 17 00:00:00 2001 From: Simon Sprankel Date: Tue, 15 Aug 2023 16:53:02 +0200 Subject: [PATCH] Only execute phpcs if changes exist (#99) --- coding-standard-baseline/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coding-standard-baseline/action.yml b/coding-standard-baseline/action.yml index 16c7cbd..cca387c 100755 --- a/coding-standard-baseline/action.yml +++ b/coding-standard-baseline/action.yml @@ -87,6 +87,7 @@ runs: - name: Checkout - Before Merge shell: bash + if: ${{ hashFiles('phpcs_files.txt') != '' }} run: | if ${{ github.event_name == 'pull_request' }}; then git checkout ${{ github.event.pull_request.base.ref }} @@ -96,6 +97,7 @@ runs: - name: Filter php files and execute phpcs - Before Merge shell: bash + if: ${{ hashFiles('phpcs_files.txt') != '' }} run: | php vendor/bin/phpcs --standard=Magento2 \ $([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \ @@ -105,6 +107,7 @@ runs: - name: Checkout after Merge and execute phpcs shell: bash + if: ${{ hashFiles('phpcs_files.txt') != '' }} run: | if ${{ github.event_name == 'pull_request' }}; then git checkout ${{ github.event.pull_request.head.ref }}