Skip to content

Commit

Permalink
formatting action
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Jan 27, 2024
1 parent 4042777 commit bc0f481
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ jobs:
with:
node-version: 16

- name: Format code
run: |
echo "running formatting"
npm run format
echo "running php-cs-fixer..."
vendor/bin/php-cs-fixer fix
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Prettify Code

on: [ push ]

jobs:
test:
runs-on: ubuntu-20.04

env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: zip, sqlite3
coverage: none

- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install node dependencies
run: npm ci

- name: Restore composer cache
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Code Formatting
run: |
echo "running prettier..."
npm run format
echo "running php-cs-fixer..."
vendor/bin/php-cs-fixer fix
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply Code Style Fixes

0 comments on commit bc0f481

Please sign in to comment.