|
70 | 70 | with: |
71 | 71 | list-files: shell |
72 | 72 | filters: | |
| 73 | + baseline: |
| 74 | + - modified: '**/**.{php,phtml,graphqls,less,css,html,xml,js}' |
73 | 75 | phpcs: |
74 | 76 | - added|modified: '**/**.{php,phtml,graphqls,less,css,html,xml,js}' |
75 | 77 |
|
|
78 | 80 | shell: bash |
79 | 81 | run: | |
80 | 82 | echo "One or more files relevant to PHPCS have changed." |
81 | | - echo "List all the files that have changed: ${{ steps.filter.outputs.phpcs_files }}" |
| 83 | + echo "List all the files that have been added or changed: ${{ steps.filter.outputs.phpcs_files }}" |
82 | 84 |
|
83 | 85 | - name: Setup PHP |
84 | 86 | if: steps.filter.outputs.phpcs == 'true' |
@@ -115,25 +117,25 @@ runs: |
115 | 117 | - name: Create phpcs.baseline.xml from base |
116 | 118 | shell: bash |
117 | 119 | working-directory: base |
118 | | - if: steps.filter.outputs.phpcs == 'true' |
| 120 | + if: steps.filter.outputs.baseline == 'true' |
119 | 121 | run: | |
120 | 122 | php ${{ github.workspace }}/magento-coding-standard/vendor/bin/phpcs --standard=Magento2 \ |
121 | 123 | $([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \ |
122 | 124 | $([ -n "${{ inputs.warning_severity }}" ] && echo "--warning-severity=${{ inputs.warning_severity }}") \ |
123 | 125 | $([ -n "${{ inputs.error_severity }}" ] && echo "--error-severity=${{ inputs.error_severity }}") \ |
124 | 126 | --report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml \ |
125 | | - ${{ steps.filter.outputs.phpcs_files }} || /bin/true |
| 127 | + ${{ steps.filter.outputs.baseline_files }} || /bin/true |
126 | 128 |
|
127 | 129 | - name: Copy baseline to head |
128 | | - if: steps.filter.outputs.phpcs == 'true' |
| 130 | + if: steps.filter.outputs.baseline == 'true' |
129 | 131 | shell: bash |
130 | 132 | run: | |
131 | 133 | cp ${{ github.workspace }}/base/phpcs.baseline.xml ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml |
132 | 134 |
|
133 | 135 | # Since we ran phpcs in the base folder, the files in phpcs.baseline.xml contain the base folder in the path. |
134 | 136 | # We need to remove /base/ so that the phpcs can locate the correct files. |
135 | 137 | - name: Remove base dir from phpcs baseline |
136 | | - if: steps.filter.outputs.phpcs == 'true' |
| 138 | + if: steps.filter.outputs.baseline == 'true' |
137 | 139 | shell: bash |
138 | 140 | run: | |
139 | 141 | sed -i "s|/base/|/|" ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml |
|
0 commit comments