Skip to content

Commit 518ea92

Browse files
committed
Replace andstor/file-existence-action with one-liner
1 parent 52fda90 commit 518ea92

File tree

6 files changed

+14
-40
lines changed

6 files changed

+14
-40
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ jobs:
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
25-
with:
26-
files: "composer.json"
24+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
2725

2826
- name: Set up PHP environment
2927
if: steps.check_composer_file.outputs.files_exists == 'true'

.github/workflows/reusable-check-branch-alias.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ jobs:
4040

4141
- name: Check existence of composer.json file
4242
id: check_composer_file
43-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
44-
with:
45-
files: "composer.json"
43+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
4644

4745
- name: Check and update branch alias
4846
if: steps.check_composer_file.outputs.files_exists == 'true'

.github/workflows/reusable-code-quality.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ jobs:
4646

4747
- name: Check existence of composer.json file
4848
id: check_composer_file
49-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
50-
with:
51-
files: "composer.json"
49+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
5250

5351
- name: Set up PHP environment
5452
if: steps.check_composer_file.outputs.files_exists == 'true'
@@ -71,9 +69,7 @@ jobs:
7169

7270
- name: Check existence of vendor/bin/parallel-lint file
7371
id: check_linter_file
74-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
75-
with:
76-
files: "vendor/bin/parallel-lint"
72+
run: echo "files_exists=$(test -f vendor/bin/parallel-lint && echo true || echo false)" >> "$GITHUB_OUTPUT"
7773

7874
- name: Run Linter
7975
if: steps.check_linter_file.outputs.files_exists == 'true'
@@ -123,9 +119,7 @@ jobs:
123119

124120
- name: Check existence of config file
125121
id: check_files
126-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
127-
with:
128-
files: ".typos.toml"
122+
run: echo "files_exists=$(test -f .typos.toml && echo true || echo false)" >> "$GITHUB_OUTPUT"
129123

130124
- name: Check spelling
131125
if: steps.check_files.outputs.files_exists == 'true'
@@ -141,9 +135,7 @@ jobs:
141135

142136
- name: Check existence of composer.json & phpcs.xml.dist files
143137
id: check_files
144-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
145-
with:
146-
files: "composer.json, phpcs.xml.dist"
138+
run: echo "files_exists=$([ -f composer.json ] && [ -f phpcs.xml.dist ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
147139

148140
- name: Set up PHP environment
149141
if: steps.check_files.outputs.files_exists == 'true'
@@ -165,9 +157,7 @@ jobs:
165157

166158
- name: Check existence of vendor/bin/phpcs file
167159
id: check_phpcs_binary_file
168-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
169-
with:
170-
files: "vendor/bin/phpcs"
160+
run: echo "files_exists=$(test -f vendor/bin/phpcs && echo true || echo false)" >> "$GITHUB_OUTPUT"
171161

172162
- name: Run PHPCS
173163
if: steps.check_phpcs_binary_file.outputs.files_exists == 'true'
@@ -188,11 +178,9 @@ jobs:
188178
- name: Check out source code
189179
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
190180

191-
- name: Check existence of composer.json & phpcs.xml.dist files
181+
- name: Check existence of composer.json file
192182
id: check_files
193-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
194-
with:
195-
files: "composer.json"
183+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
196184

197185
- name: Set up PHP environment
198186
if: steps.check_files.outputs.files_exists == 'true'
@@ -214,9 +202,7 @@ jobs:
214202

215203
- name: Check existence of vendor/bin/phpstan file
216204
id: check_phpstan_binary_file
217-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
218-
with:
219-
files: "vendor/bin/phpstan"
205+
run: echo "files_exists=$(test -f vendor/bin/phpstan && echo true || echo false)" >> "$GITHUB_OUTPUT"
220206

221207
- name: Run PHPStan
222208
if: steps.check_phpstan_binary_file.outputs.files_exists == 'true'

.github/workflows/reusable-manage-labels.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ jobs:
2626

2727
- name: Check existence of composer.json file
2828
id: check_composer_file
29-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
30-
with:
31-
files: "composer.json"
29+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
3230

3331
- name: Get commands from composer.json
3432
id: get-commands

.github/workflows/reusable-regenerate-readme.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ jobs:
3333

3434
- name: Check existence of composer.json file
3535
id: check_composer_file
36-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
37-
with:
38-
files: "composer.json"
36+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
3937

4038
- name: Install Composer dependencies & cache dependencies
4139
if: steps.check_composer_file.outputs.files_exists == 'true'

.github/workflows/reusable-testing.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,7 @@ jobs:
325325

326326
- name: Check existence of composer.json & phpunit.xml.dist files
327327
id: check_files
328-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
329-
with:
330-
files: "composer.json, phpunit.xml.dist"
328+
run: echo "files_exists=$([ -f composer.json ] && [ -f phpunit.xml.dist ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
331329

332330
- name: Set matrix
333331
id: set-matrix
@@ -442,9 +440,7 @@ jobs:
442440

443441
- name: Check existence of composer.json & behat.yml files
444442
id: check_files
445-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
446-
with:
447-
files: "composer.json, behat.yml"
443+
run: echo "files_exists=$([ -f composer.json ] && [ -f behat.yml ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
448444

449445
- name: Set matrix
450446
id: set-matrix

0 commit comments

Comments
 (0)