Skip to content

Merge pull request #940 from Ansh101112/wish #35

Merge pull request #940 from Ansh101112/wish

Merge pull request #940 from Ansh101112/wish #35

Workflow file for this run

name: Auto Format with Prettier
on:
push:
branches:
- main # Adjust as per your default branch
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Node.js and npm
uses: actions/setup-node@v2
with:
node-version: '14' # Adjust to match your project's Node.js version
- name: Install dependencies
run: npm install
- name: Run Prettier to format code
run: npm run format
- name: Commit formatted code
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Auto-format code using Prettier"
git push origin main