diff --git a/.github/workflows/add-strict-types.yml b/.github/workflows/add-strict-types.yml index b3ef823747..20b6e4186f 100644 --- a/.github/workflows/add-strict-types.yml +++ b/.github/workflows/add-strict-types.yml @@ -18,39 +18,31 @@ jobs: with: php-version: '8.1' - - name: Check for new PHP files - id: check + - name: Add strict types to new PHP files + id: add_strict_types run: | - git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk + 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 \)') if [ -n "$NEW_PHP_FILES" ]; then + echo "$NEW_PHP_FILES" | xargs -I {} sed -i '1s|^|