From 3f9d16a096c2c0f9cc15fa847eefd0f159901eb7 Mon Sep 17 00:00:00 2001 From: Jellyfrog Date: Fri, 6 Aug 2021 16:40:04 +0200 Subject: [PATCH] Run PHPStan with higher level for new files (#13108) --- .github/workflows/lint.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2a302b3cdc..72e29c61d5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,7 +33,21 @@ jobs: name: PHP Static Analysis runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - + name: Checkout Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - + name: Determine added files + run: | + ADDED_FILES=$(git diff --name-only --diff-filter="A" origin/master -- app/ config/ database/ LibreNMS/ resources/ tests/ | tr '\n' ' '|sed 's/,*$//g') + echo $ADDED_FILES + + echo 'ADDED_FILES<> $GITHUB_ENV + echo $ADDED_FILES >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - name: Set up PHP @@ -68,5 +82,10 @@ jobs: run: composer install --prefer-dist --no-interaction --no-progress - - name: Run phpstan + name: Run PHPStan run: ./vendor/bin/phpstan analyze --no-interaction --no-progress --error-format=github --memory-limit=4G + + - + name: Run PHPStan (New files) + run: ./vendor/bin/phpstan analyze --no-interaction --no-progress --error-format=github --memory-limit=4G --level=6 -- $ADDED_FILES + if: ${{ env.ADDED_FILES }}