Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1088-code-style-setup #97

Merged
merged 15 commits into from
Jan 6, 2025
Prev Previous commit
Next Next commit
feat(cs): add pipeline
mahiarirani committed Dec 28, 2024
commit 48b5eb3a7858040278816c2d3d7822e63499056e
45 changes: 45 additions & 0 deletions .github/workflows/cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Code Style Fixer

on:
pull_request:
branches:
- 'stage'
types:
- opened
- synchronize
- reopened

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: composer

- name: Install dependencies
run: composer install

- name: Run code fixer
run: vendor/bin/php-cs-fixer fix

- name: Check for fix changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "Fix changes detected";
git config user.name "${{ github.actor }}";
git config user.email "${{ github.actor }}@users.noreply.github.com";
git commit -am "chore: code style fix";
else
echo "No fix changes detected";
fi

- name: Push changes
if: success()
run: git push