Update deps, add php-cs-fix config #9
Workflow file for this run
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
name: Check & Fix Styling | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
php-cs-fixer: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
# Step to set the ARGS depending on whether the .php-cs-fixer.dist.php file exists | |
- name: Set config argument | |
id: set-config | |
run: | | |
if [ -f ./.php-cs-fixer.dist.php ]; then | |
echo "ARGS=--config=.php-cs-fixer.dist.php --allow-risky=yes" >> "$GITHUB_OUTPUT" | |
else | |
echo "ARGS=. --allow-risky=yes" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Run PHP CS Fixer | |
uses: docker://oskarstark/php-cs-fixer-ga | |
with: | |
args: ${{ steps.set-config.outputs.ARGS }} | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Fix styling |