diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a9908fa --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +/.github/ @SRWieZ diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8771be3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + time: "09:00" + timezone: "Europe/Paris" + labels: + - "dependencies" + - "ci" + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 2868d8d..be473dd 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -1,35 +1,32 @@ name: Linting + on: workflow_dispatch: + pull_request: push: - branches-ignore: - - 'dependabot/npm_and_yarn/*' + branches: + - main + +permissions: + contents: read + jobs: pint: runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1 with: php-version: '8.3' tools: composer:v2 - - name: Copy .env - run: php -r "file_exists('.env') || copy('.env.example', '.env');" - - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Launch Pint inspection - run: vendor/bin/pint - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: PHP Linting (Pint) - skip_fetch: true \ No newline at end of file + - name: Run Pint + run: vendor/bin/pint --test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a61436..3906351 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,9 @@ on: branches: - main +permissions: + contents: read + jobs: test: runs-on: ${{ matrix.os }} @@ -19,10 +22,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1 with: php-version: ${{ matrix.php }} tools: composer:v2 @@ -41,7 +46,7 @@ jobs: echo "dir=$dir" >> $env:GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ steps.composer-cache-unix.outputs.dir || steps.composer-cache-windows.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -51,4 +56,4 @@ jobs: run: composer update --no-interaction --prefer-dist - name: Run tests - run: ./vendor/bin/pest \ No newline at end of file + run: ./vendor/bin/pest diff --git a/cli/publicip.php b/cli/publicip.php index 7bd3402..028a2fc 100644 --- a/cli/publicip.php +++ b/cli/publicip.php @@ -4,6 +4,7 @@ use KnotsPHP\PublicIP\Finders\PublicIP; use KnotsPHP\PublicIP\Finders\PublicIPv4; use KnotsPHP\PublicIP\Finders\PublicIPv6; +use NunoMaduro\Collision\Provider; error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE); @@ -12,7 +13,7 @@ } if (class_exists('\NunoMaduro\Collision\Provider')) { - (new \NunoMaduro\Collision\Provider)->register(); + (new Provider)->register(); } $ipVersion = null;