Prettier #56
This file contains 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: Prettier | |
on: | |
# pull_request_target: | |
# types: | |
# - opened | |
# - synchronize | |
# - reopened | |
# - edited | |
# branches: | |
# - alpha | |
workflow_dispatch: | |
jobs: | |
prettier: | |
name: Prettify code | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.14 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run Prettier | |
run: | | |
pnpm run format | |
- name: Check linting and errors | |
run: | | |
pnpm run lint | |
pnpm run check | |
- name: Commit changes | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m 'style(prettier): run prettier' || echo "No changes to commit" | |
- name: Push changes | |
run: git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |