Skip to content

Commit bce04f5

Browse files
committed
feat: Add support for custom working directory
1 parent a7bc1b4 commit bce04f5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/php-static-analysis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
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.
@@ -27,6 +32,9 @@ jobs:
2732
php-static-analysis:
2833
name: PHP Static analysis
2934
runs-on: ubuntu-latest
35+
defaults:
36+
run:
37+
working-directory: ${{ inputs.WORKING_DIRECTORY }}
3038
env:
3139
COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}'
3240
PHPSTAN_EDITOR_URL: 'phpstorm://open?file=%file%&line=%line%'
@@ -45,7 +53,7 @@ jobs:
4553

4654
- name: Get changed files
4755
id: changed-files
48-
uses: tj-actions/changed-files@v45
56+
uses: tj-actions/changed-files@v47
4957

5058
- name: Run PHPStan
5159
if: steps.changed-files.outputs.all_changed_files != ''

0 commit comments

Comments
 (0)