Skip to content

feat: add lint, format and test workflows for CI #4

feat: add lint, format and test workflows for CI

feat: add lint, format and test workflows for CI #4

Workflow file for this run

name: Format
on:
push:
branches: [dev]
pull_request:
branches: [main, dev]
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: true
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Install dependencies
run: pnpm install
- name: Check formatting
run: pnpm run format:check
- name: Format code
run: pnpm run format
- name: Commit formatted files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "style: format code" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}