Skip to content

Commit

Permalink
Auto format workflow (#600)
Browse files Browse the repository at this point in the history
* Auto format workflow

* Fix negation

* commit as AdyenAutomationBot
  • Loading branch information
michaelpaul authored Dec 5, 2023
1 parent 0a6d6d1 commit d2aee8b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PHP Format

on:
push:
branches:
- 'sdk-automation/models'

jobs:
format:
if: ${{ ! startsWith(github.event.head_commit.message, 'style(fmt)') }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v1
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHP Code Sniffer
run: composer run fmt || true
- run: |
git config user.name AdyenAutomationBot
git config user.email "${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}"
git add .
git commit -m "style(fmt): code formatted"
git push
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"psr-4": {
"Adyen\\Tests\\": "tests/"
}
},
"scripts": {
"fmt": "phpcbf src/Adyen/Service/** src/Adyen/Model/**"
}
}

0 comments on commit d2aee8b

Please sign in to comment.