From 93d74a1aea1a3e9b83fca2ca8d8dbaca9ff93f6e Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Tue, 12 Dec 2023 11:59:55 -0300 Subject: [PATCH] try to handle grep exit gracefully --- .github/workflows/add-strict-types.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-strict-types.yml b/.github/workflows/add-strict-types.yml index b3ef823747..5ab84240fa 100644 --- a/.github/workflows/add-strict-types.yml +++ b/.github/workflows/add-strict-types.yml @@ -21,8 +21,8 @@ jobs: - name: Check for new PHP files id: check run: | - git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk - NEW_PHP_FILES=$(git diff --name-only refs/remotes/origin/trunk HEAD -- '*.php' | xargs -r grep -LE 'declare\( strict_types=1 \)') + git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk --quiet + NEW_PHP_FILES=$(git diff --name-only refs/remotes/origin/trunk HEAD -- '*.php' | xargs -r grep -LE 'declare\( strict_types=1 \)' || true) if [ -n "$NEW_PHP_FILES" ]; then echo "::set-output name=strict_types_needed::true" echo "New PHP files without strict types: $NEW_PHP_FILES" @@ -30,6 +30,7 @@ jobs: echo "::set-output name=strict_types_needed::false" fi + - name: Add strict types to new PHP files if: steps.check.outputs.strict_types_needed == 'true'