Skip to content

dggdd

dggdd #2

Workflow file for this run

name: Format Code
on:
push:
branches:
- main
- 'feature'
- 'test'
pull_request:
branches:
- main
- 'feature'
- 'test'
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Run Prettier
run: npx prettier --write .
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m 'Format code with Prettier' || echo 'No changes to commit'
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
- name: Push changes
run: git push
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}