File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ inputs:
3030 description : Composer configuration as a JSON formatted object.
3131 required : false
3232 type : string
33+ WORKING_DIRECTORY :
34+ description : The working directory where to run the static analysis.
35+ default : ' .'
36+ required : false
37+ type : string
3338
3439secrets :
3540 COMPOSER_AUTH_JSON :
5762 if : ${{ inputs.INSTALL_AND_CACHE == 'true' }}
5863 with :
5964 composer-options : ${{ inputs.COMPOSER_ARGS }}
65+ working-directory : ${{ inputs.WORKING_DIRECTORY }}
Original file line number Diff line number Diff line change 1818 default : ' --error-format=checkstyle'
1919 required : false
2020 type : string
21+ WORKING_DIRECTORY :
22+ description : The working directory where to run the static analysis.
23+ default : ' .'
24+ required : false
25+ type : string
2126 secrets :
2227 COMPOSER_AUTH_JSON :
2328 description : Authentication for privately hosted packages and repositories as a JSON formatted object.
2732 php-static-analysis :
2833 name : PHP Static analysis
2934 runs-on : ubuntu-latest
35+ defaults :
36+ run :
37+ shell : bash
38+ working-directory : ${{ inputs.WORKING_DIRECTORY }}
3039 env :
3140 COMPOSER_AUTH : ' ${{ secrets.COMPOSER_AUTH_JSON }}'
3241 PHPSTAN_EDITOR_URL : ' phpstorm://open?file=%file%&line=%line%'
@@ -42,11 +51,19 @@ jobs:
4251 PHP_VERSION : ${{ inputs.PHP_VERSION }}
4352 PHP_TOOLS : " composer, cs2pr"
4453 COMPOSER_CONFIG : ${{ vars.COMPOSER_CONFIG_JSON }}
54+ WORKING_DIRECTORY : ${{ inputs.WORKING_DIRECTORY }}
4555
4656 - name : Get changed files
4757 id : changed-files
48- uses : tj-actions/changed-files@v45
58+ uses : tj-actions/changed-files@v47
59+ with :
60+ path : ${{ inputs.WORKING_DIRECTORY }}
61+ files : |
62+ **/*.php
4963
5064 - name : Run PHPStan
5165 if : steps.changed-files.outputs.all_changed_files != ''
52- run : ./vendor/bin/phpstan analyse ${{ inputs.PHPSTAN_ARGS }} ${{ join(steps.changed-files.outputs.all_changed_files, ' ') }} | cs2pr
66+ run : |
67+ ./vendor/bin/phpstan analyse ${{ inputs.PHPSTAN_ARGS }} ${{ steps.changed-files.outputs.all_changed_files }} \
68+ | sed 's|name="|name="${{ inputs.WORKING_DIRECTORY }}/|g' \
69+ | cs2pr
You can’t perform that action at this time.
0 commit comments