-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Pint integration in CI workflow
This commit refines the Pint code style check by adding a conditional check based on the outcome of the pint-check step. It restructures the Pint fixes application to include a rebase before pushing changes to avoid conflicts.
- Loading branch information
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
php-version: ['8.2', '8.3'] | ||
php-version: [ '8.2', '8.3' ] | ||
include: | ||
- php-version: '8.3' | ||
latest: true | ||
|
@@ -51,17 +51,22 @@ jobs: | |
|
||
- name: Check code style with Pint | ||
if: matrix.latest == true | ||
id: pint-check | ||
run: composer run pint -- --test | ||
continue-on-error: true | ||
|
||
- name: Apply Pint fixes | ||
if: failure() && matrix.latest == true | ||
if: matrix.latest == true && steps.pint-check.outcome == 'failure' | ||
run: | | ||
composer run pint | ||
git config --local user.name "GitHub Actions" | ||
git config --local user.email "[email protected]" | ||
git commit -am "Apply Pint fixes" || echo "No changes to commit" | ||
git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref }} | ||
git add . | ||
git diff --staged --quiet || { | ||
git commit -m "Apply Pint fixes" | ||
git pull --rebase origin ${{ github.head_ref || github.ref_name }} | ||
git push origin HEAD:${{ github.head_ref || github.ref_name }} | ||
} | ||
phpstan: | ||
runs-on: ubuntu-latest | ||
|