Skip to content

Prettier

Prettier #53

Workflow file for this run

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: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install npm dependencies
run: npm install
- name: Run Prettier
run: |
npm run format
- name: Check linting and errors
run: |
npm run lint
npm 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 }}