Skip to content

Commit

Permalink
fix: prettier-action init
Browse files Browse the repository at this point in the history
  • Loading branch information
Salman2301 committed Oct 31, 2024
1 parent 18fb1e9 commit 92a8eb5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ name: Format
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]

- name: Setup Node.js environment
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
with:
node-version: 18

- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Format
run: pnpm run format
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

- name: Add, Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
- name: Prettier Action
uses: creyD/prettier_action@v4.3
with:
commit_message: 'Format'
prettier_options: '--config ./.prettierrc --ignore-path .gitignore -w "packages/**/*.{js,ts,json,css,tsx,jsx,md}" "playgrounds/**/*.{js,ts,json,css,tsx,jsx,md}"'
commit_message: "style: auto-format with action"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ pnpm run dev

This will start all the playground in watch mode.


> [!NOTE]
> Once a pull request is submitted, we run a prettier auto-format action and create a new commit if it's not formatted properly. Be sure to pull the latest changes after submitting a pull request or run `pnpm run format` to format your changes locally before submitting a new pull request.
### SolidJS

The project is built using [SolidJS](https://www.solidjs.com/). If you are new to SolidJS, we recommend checking out their [documentation](https://www.solidjs.com/docs) and [tutorials](https://www.solidjs.com/tutorial).
Expand Down

0 comments on commit 92a8eb5

Please sign in to comment.