Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 93d74a1

Browse files
author
Vicente Canales
committed
try to handle grep exit gracefully
1 parent 39ad668 commit 93d74a1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/add-strict-types.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ jobs:
2121
- name: Check for new PHP files
2222
id: check
2323
run: |
24-
git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk
25-
NEW_PHP_FILES=$(git diff --name-only refs/remotes/origin/trunk HEAD -- '*.php' | xargs -r grep -LE 'declare\( strict_types=1 \)')
24+
git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk --quiet
25+
NEW_PHP_FILES=$(git diff --name-only refs/remotes/origin/trunk HEAD -- '*.php' | xargs -r grep -LE 'declare\( strict_types=1 \)' || true)
2626
if [ -n "$NEW_PHP_FILES" ]; then
2727
echo "::set-output name=strict_types_needed::true"
2828
echo "New PHP files without strict types: $NEW_PHP_FILES"
2929
else
3030
echo "::set-output name=strict_types_needed::false"
3131
fi
3232
33+
3334
3435
- name: Add strict types to new PHP files
3536
if: steps.check.outputs.strict_types_needed == 'true'

0 commit comments

Comments
 (0)