Skip to content

Commit

Permalink
Rector GH action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jewei committed Apr 28, 2024
1 parent f805a3c commit d9f0f64
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# github action that checks code with Rector
name: Rector

on:
pull_request: null

jobs:
rector:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == 'jewei/laravel-skeleton'
steps:
- if: github.event.pull_request.head.repo.full_name == github.repository
uses: actions/checkout@v4
with:
# Must be used to trigger workflow after push
token: ${{ secrets.ACCESS_TOKEN }}

- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none

- uses: "ramsey/composer-install@v3"

- run: vendor/bin/rector --ansi
# @todo apply coding standard if used

- # commit only to core contributors who have repository access
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[rector] Rector fixes"
commit_author: "GitHub Action <[email protected]>"
commit_user_email: "[email protected]"
2 changes: 2 additions & 0 deletions app/Http/Middleware/Idempotency.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Idempotency

/**
* The verbs that are considered idempotent.
*
* @var array<int, string>
*/
protected array $verbs = ['POST', 'PUT', 'PATCH', 'DELETE'];

Expand Down
6 changes: 3 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
//
])
->withSets([
LaravelSetList::LARAVEL_110,
LaravelSetList::ARRAY_STR_FUNCTIONS_TO_STATIC_CALL,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_110,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
]);

0 comments on commit d9f0f64

Please sign in to comment.