Skip to content

Commit

Permalink
feat: run Prettier on merge to main
Browse files Browse the repository at this point in the history
  • Loading branch information
maneike committed Oct 10, 2024
1 parent e8df28e commit 5052a02
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Prettier Check on Merge

on:
push:
branches:
- main

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: pnpm ci

- name: Run Prettier on specific directories
run: npx prettier --write './packages/core/**/*' './packages/cli/**/*'

- name: Commit changes if any
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 "Apply Prettier formatting"
git push
continue-on-error: true

0 comments on commit 5052a02

Please sign in to comment.