readme update, final initializations #3
This file contains hidden or 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: Auto Format Code | |
| on: | |
| push: | |
| branches: [ main, develop, feature/*, bugfix/* ] | |
| jobs: | |
| format: | |
| name: Auto Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: | | |
| frontend/package-lock.json | |
| backend/package-lock.json | |
| - name: Install frontend dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Format frontend code | |
| working-directory: ./frontend | |
| run: npm run format | |
| - name: Install backend dependencies | |
| working-directory: ./backend | |
| run: npm ci | |
| - name: Format backend code | |
| working-directory: ./backend | |
| run: npm run format | |
| - name: Commit formatted code | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add . | |
| git diff --staged --quiet || git commit -m "Auto-format code with Prettier" | |
| git push |