Skip to content

Commit 03576e7

Browse files
Copilotswissspidy
andcommitted
Add composer.json existence check for extra hardening
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent ee1e47a commit 03576e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ jobs:
1919
- name: Checkout code
2020
uses: actions/checkout@v5
2121

22+
- name: Check existence of composer.json file
23+
id: check_composer_file
24+
uses: andstor/file-existence-action@v3
25+
with:
26+
files: "composer.json"
27+
2228
- name: Set up PHP environment
29+
if: steps.check_composer_file.outputs.files_exists == 'true'
2330
uses: shivammathur/setup-php@v2
2431
with:
2532
php-version: 'latest'
@@ -30,6 +37,7 @@ jobs:
3037
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3138

3239
- name: Install Composer dependencies & cache dependencies
40+
if: steps.check_composer_file.outputs.files_exists == 'true'
3341
uses: ramsey/composer-install@v3
3442
env:
3543
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}

0 commit comments

Comments
 (0)