Skip to content

Commit

Permalink
Merge pull request #5 from midnite81/internal/update-ci
Browse files Browse the repository at this point in the history
Improve Pint integration in CI workflow
  • Loading branch information
midnite81 authored Oct 6, 2024
2 parents de380a2 + 69f18c8 commit 0146ee1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0146ee1

Please sign in to comment.